Sorry, I forgot to make an example trigger after work. I can throw an example right now though.
So let's say a hero has 100 strength when he acquires an item that gives 10% bonus STR. If you add the hero to a loop, and save the 100 (their base STR) and save 10% of that (10, which is the bonus amount) BEFORE you add the bonus.
Recap: The hero is saved inside of a loop with the numbers 100 and 10, so 3 different variables in a loop. The hero currently has 110 strength.
So periodically you would take the hero's current strength (110) and subtract the bonus amount (10). If it matches up with the base strength (100) then nothing has changed.
Now let's say the hero levels up and gains 10 strength. Now he's at 120. When the loop runs, you get 120 - 10 = 110, which is not 100. So you know his strength value has changed.
Subtract the bonus value from his current strength (120 - 10 = 110) and reapply the original stat adjustment. ( the hero has a base strength of 110, bonus is now 11). Add the bonus and now he's at 121 as he should be.
Hopefully this makes sense!

This same logic can be applied to agility, intelligence, HP, and MP. Other stats like armor, attack speed, etc. could possibly work if you have an easy way to track them.