Getting Some Lag when healing

Im sure im doing something wrong here as im extremely new and still learning the basics about JS
so heres the thing, I have this Code

JavaScript:
<Custom Parameters>
if (user.hp >= user.mhp*0.75) {
atk = user.level+(user.luk*0.25);
def = user.level+(user.luk*0.25);
mat = user.level+(user.luk*0.25);
mdf = user.level+(user.luk*0.25);
agi = user.level+(user.luk*0.25);
}else {
atk = user.level-(user.luk*0.5);
def = user.level-(user.luk*0.5);
mat = user.level-(user.luk*0.5);
mdf = user.level-(user.luk*0.5);
agi = user.level-(user.luk*0.5);
}
</Custom Parameters>

basically it sounds simple enough, This is a notetag on a Weapon.
When character has this weapon equiped and their HP is 75% or more they get their stats boosted by 25% of their LUCK
otherwise their stats get minus 50% of their Luck.
so the code itself works perfectly how i want it, i damaged the character adn saw the changes but when i was healing the character back to 100% to see that the stats update when healing is done my game just kinda froze o:
is there something wrong with the code or what happened?
every time i try to heal the character with the weapon equiped the game freezes o:
im using Yanfly's Custom Parameters for the notetag
any help would be appreciated im a super noob at this i dont even know what to check for a fix xD
Shameless Bump, still havent been able to solve this u.u

Original thread: https://forums.rpgmakerweb.com/threads/getting-some-lag-when-healing.125354/