The good news is there's already a built-in function to do this for you: just do
Code:
condition = target.hpRate() >= 0.75;
condition = target.hpRate() >= 0.75;
<JS Pre-Damage as User>
if (!user.isStateAffected(14)) {
user._attackStack = user._attackStack || 0;
user._attackStack++;
user.setStateDisplay(11, user._attackStack);
if (user._attackStack == 3) {
user.addState(14);
}
}
</JS Pre-Damage as User>
<JS Post-Damage as User>
delete user._attackStack;
user.setStateDisplay(11, "");
user.removeState(14);
</JS Post-Damage as User>
<JS Item Enable>
enabled = BattleManager.actor().actorId() === ID OF ACTOR;
</JS Item Enable>
<JS On Add State>
if(target.isHpRecover()){
value = Math.abs(value);
}
</JS On Add State>
SceneManager.exit();
Original thread: https://forums.rpgmakerweb.com/threads/the-official-visustella-notetag-help-thread.125717/