There is a special utility called AboutHeroes3, which indicates the probability of skills appearing for each hero (as in section 1.4 of PhysMiGa).
At the end of this page http://heroes.ag.ru/h3/ there is a brief description and a link to download http://heroes.ag.ru/h3/utils/AboutHeroes3.rar
There is also a small brochure in English called "Leveling-Up in Heroes of Might and Magic III", which describes the game's algorithm for choosing a skill when leveling up.
In general, in my opinion, these trees are the first thing that should be "uprooted" from the game! How many times has my hero not received the urgently needed earth magic or wisdom! It is not for nothing that they added the Time Market in WoG, which allows you to get rid of unnecessary skills for money, which the game "forced" on you.
(Василь Симоненко. Люди – прекрасні)