Script call question

Hello everyone. I was wondering if I could get some help with this script. I want to check after every battle is over if the party has a certain state on them. If they have the state I want to restore their hp back to a certain percentage. I currently have this.
$gameParty.battleMembers().forEach(function(actor)
{
if(actor.isStateAffected(62) === true){
var setHp = actor.mhp*75;
actor.gainHp(setHp);}

else if(actor.isStateAffected(63) === true){
actor.gainHp(actor.mhp*50);}

else if(actor.isStateAffected(64) === true){
actor.gainHp(actor.mhp*20);}

else{
actor.gainHp(actor.mhp);}
})


For some reason the player is always healed fully instead. I tried doing an if statement to check if the player has the correct state to allow a full heal but this still doesn't change anything
In case you haven't solved this yet: The problem is that you're not multiplying with a percentage, but with an integer. For example, when you write actor.mhp*20, that is twenty times the maximum HP, not twenty percent of the max HP. Try 0.75 (0.5 , 0.2) or 75/100 (50/100, 20/100) * actor.mhp
Wow! Well do I feel silly. Thank you so much, I think I just got super caught up with my game that I missed the little things. Thanks again!

Original thread: https://forums.rpgmakerweb.com/threads/script-call-question.78441/