MV YEP_BuffsandStatesCore Custom Remove Effect Assistance

Good evening RPGM Community!

I am attempting to get the following Javascript to work imbedded within state 29 of my game using the YEP_BuffsandStatesCore plugin:

JavaScript:
<Custom Remove Effect>
if (user.actorId() === 9) {
  condition = $gameVariable.value(4996)==0;
} else if (user.actorId() === 50) {
  condition = $gameVariable.value(4988)==0;
} else if (user.actorId() === 63) {
  condition = $gameVariable.value(4936)==0;
}
</Custom Remove Effect>

The end state would be if state 29 is removed from any of the actors listed above; it sets their assigned control variable to "0", but currently, the script is not working.

Assistance is appreciated; thanks!
Code:
  condition = $gameVariable.value(4996)==0;
This doesn't mean anything like what you said. You are setting a variable named condition (which you never declared) to the result of whether variable 4996 is equal to 0.

So at the end of your code, you're going to have this condition variable that has a value of either true or false...and then you don't do anything else with it.

I think you've gotten yourself badly confused with passive state notetags, which use condition to determine whether or not the state is active.

What you want to be doing is setting the value of these variables, according to your description. So you would be using the setValue function, not checking what the value of the game variable already is.

Code:
if (user.actorId()==9)
    $gameVariables.setValue(4996, 0);

Original thread: https://forums.rpgmakerweb.com/threads/yep_buffsandstatescore-custom-remove-effect-assistance.153767/