<Custom Apply Effect>
var atkcount = 1; //This is the attack counter. Change it to fit your purpose
target._attackCount = target._attackCount || atkcount;
target.setStateCounter(99, target._attackCount); //Set a counter to your state. Change X to your state ID
</Custom Apply Effect>
<Custom React Effect>
//Check if actor takes dmg
if (value > 0 && !this.isHpRecover()){
//Decrease the attack counter by 1
target._attackCount -= 1;
//Set a counter to your state. Change X to your state ID
target.setStateCounter(99, target._attackCount);
//Check if attack counter reaches 0
if (target._attackCount <=0){
//Remove the state. Change X to your state ID
target.removeState(99);}}
</Custom React Effect>
<Custom Remove Effect>
user._attackCount = undefined;
</Custom Remove Effect>