could you please try to explai what it is you are trying to do there?
What is this line supposed to achieve?
add 1 + 1 * int((text.MaxHp -HP/10) to HP
text.maxHp, so MaxHp is an instance variable of the text?
Why not use a global variable MaxHp?
Why HP/10?
If I understand what you are trying to do, it will probably be easier to see where you go wrong.