Yanfly Auto Passive States conditions not working

Hi 🙏 this is my first time posting here. I'm trying to do something simple with Yanfly's Auto Passive States plugin but it's not working as intended. The idea is a combat system where the player acts 3 times to make combos with skills, so the enemy has a passive state that makes it unable to act when the "actions remaining" variable is greater than 0 so when it hits 0 the enemy attacks and sets it back to 3. I used the custom passive condition notetag to achieve this as such (and some other ways that also didn't work😅)


<Passive State: 11>



<Custom Passive Condition>

var AR = $gameVariables.value(2);

if (AR > 0) {

condition = true;

} else {

condition = false;

}

</Custom Passive Condition>

But when AR reaches 0 the enemy is still unable to move, so I keep attacking it making AR go to negative values

1705245462973.png


I'm pretty much a newbie, Please be patient if the fix here is too obvious 😢
I have moved this thread from RPG Maker MZ Support to JavaScript/Plugin Support. Welcome to the forum! Have fun, good luck!
<Passive State: 11>
this is in the enemy's notebox...

<Custom Passive Condition>

var AR = $gameVariables.value(2);

if (AR > 0) {

condition = true;

} else {

condition = false;

}

</Custom Passive Condition>
and this is in state 11's notebox, correct? and the state just restricts actions?

Is there a reason you arent using the action times + trait? By the description of the mechanic, it sounded like adding 2 100%s to the actor every turn would be the easier solution instead of paralyzing the enemy for 3 turns (im assuming turns are still passing between actions if youre not using actions+)

also your condition could be condensed to
Code:
condition = $gameVariables.value(2) > 2;
and this is in state 11's notebox, correct?
No... It was on the enemy's notebox too -w-, I put it on the states notebox and it did the trick.

Is there a reason you arent using the action times + trait?
You've just taught me that I can do that, I really wasn't making things easy on myself lol.

Thanks a ton! You fixed my issue 🙏.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-auto-passive-states-conditions-not-working.164785/