Natural Bond is almost there, but not quite. I shall try to solve this problem myself, but as the code is written, there is the possibility that a character will receive an incorrect bonus from this feat. Let me explain with an example.
If you have a 6th level ranger/5th level druid, you set up a condition that won't give the ranger the correct effective level of druid. The total level (11) minus the druid level (5) gives a bonus of 6, and the minimum of 3 and 6 is 3. So, then the ranger has it's effective level increased by 3. The effective level of a Ranger is 3 (one-half his level) plus the 3 from natural bond equal 6, which exceeds the druid's level.
What, in fact, needs to be done, is a comparison of the effective level of druid to the actual druid level. I'll try to work on that and get back to you.
EDIT: Ok, just realized this is stacking. Still needs fixing but it's not as bad as I first thought. All that needs to be done is to subtract the character's effective druid level from it's total level (not the actual druid level, since a single class ranger would have no druid levels but does have effective druid levels for the purposes of animal companions). So, I'm going to try to subtract hero.childfound[cAnimClass].field[CompClLev].value from the total character level instead of the total level of druid.
EDIT2: I also had to move it to Post-Levels, but that doesn't give the correct Class Level to the Companion. Here's the problem, the class levels of the companion are determined at First 497, but the actual levels of the character are not done until 500. Trying to sync these two things is impossible (first the companion level is determined, then your effective level is determined, but it can't retroactively get the correct effective level back on the companion). This is an issue with HL and not with the coding, as far as I can tell. Trying to solve it, but don't know if it is possible.
Solution (at First/499):
Code:
~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)
~ If we are within range of our effective druid level.
var bonus as number
bonus = #totallevelcount[] - hero.childfound[cAnimClass].field[CompClLev].value
bonus = minimum(bonus,3)
~Only do stuff if the animal companion is live.
if (hero.childlives[cAnimComp] <> 0) then
~ Add 3 to our companion level.
hero.childfound[cAnimClass].field[CompClLev].value += bonus
hero.childfound[cAnimComp].field[CompLevBas].value += bonus
hero.childfound[cAnimComp].field[CompLevel].value += bonus
endif