MV Help with the formula

I'm using yanfly plugins, and I would like some help with this formula, I wanted that every time my actor missed the attack or the enemy evaded, it would increase the variable number 19 by 1 point, with a maximum of 3 points.

I was currently trying this way, but without success.

<Custom Deselect Effect>
if (target.result().missed || target.result().evaded) {
user.addStateCounter(stateId, 1);
user.clampStateCounter(stateId, 0, 3);
var newVal = $gameVariables.value(19) + 1;
if (newVal > 3) newVal = 3;
$gameVariables.setValue(19, newVal);
}
</Custom Deselect Effect>
is this state on the actor or on the enemy? deselect effects run as a response to being targeted by an action, and youre doing stuff to the user - who would be the attacker
is this state on the actor or on the enemy? deselect effects run as a response to being targeted by an action, and youre doing stuff to the user - who would be the attacker
In this case I am using a passive state in the actor, the actor is the attacker, this state is in the attacker
then you need to use one of the attacker tags such as "conclude". as a deselect effect, itll only ever run as the actor is attacked and the battlers you had in mind would be reversed
then you need to use one of the attacker tags such as "conclude". as a deselect effect, itll only ever run as the actor is attacked and the battlers you had in mind would be reversed
In this case, I always wanted my actor to miss the attack, or the enemy to dodge, increasing variable 19 by 1 point, I used deselect because missing the attack does not apply a "complete" because it did not hit, my English is terrible, sorry.
I always wanted my actor to miss the attack, or the enemy to dodge, increasing variable 19 by 1 point, I used deselect because missing the attack does not apply a "complete" because it did not hit
most of the problem is that its a deselect effect and not a conclude effect. deselect effects are only done when the person with the state is targeted by someone. if the actor has the state and you want to see if they did an attack and missed, you need to use a conclude effect.
right now as a deselect effect, your state only does anything if the actor was targeted and they dodged or the enemy missed
most of the problem is that its a deselect effect and not a conclude effect. deselect effects are only done when the person with the state is targeted by someone. if the actor has the state and you want to see if they did an attack and missed, you need to use a conclude effect.
right now as a deselect effect, your state only does anything if the actor was targeted and they dodged or the enemy missed
It worked thank you

Original thread: https://forums.rpgmakerweb.com/threads/help-with-the-formula.180232/