Himeworks Placeholder States

Hello, everyone! Just wanted to know how to do something with the plugin in the title. Basically I want to apply certain states if other ones are already affecting the target. So if "poison 1" is affecting the target, then next time I cast the same ability I want the target to be affected by "poison 2." The plugin in the title is supposed to do this, but I can't figure out how. You're supposed to write this in the notes of the "poison 0" state. The 0 state is like a placeholder that "decides" what state is to be applied.

if (a.isStateAffected(4)) {
5;
}
else {
4;
}

And it works, but just for going from "poison 1" to "poison 2." I can't make the states go from "poison 2" to "poison 3."

Please help me with this.

The page of the plugin is this one.
http://himeworks.com/2016/01/placeholder-states/

Oh, and I think this plugin is supposed to work with this other one:
http://himeworks.com/2015/11/overriding-states/

It just makes a state be able to erase other states.
you need to make the code a series of if commands instead of only a single if command. And the conditions need to be ordered from highest to lowest, like
if state poison 2 then afflict poison 3
if state poison 1 then afflict poison 2
if no state then afflict poison 1
you need to make the code a series of if commands instead of only a single if command. And the conditions need to be ordered from highest to lowest, like
if state poison 2 then afflict poison 3
if state poison 1 then afflict poison 2
if no state then afflict poison 1

Thanks a lot for your answer. Now I'm learning the logic behind this. Nevertheless, I can't make it work yet. What am I doing wrong?


<placeholder state>
if (a.isStateAffected(2)) {
3;
}
else {
if (a.isStateAffected(1)) {
2;
}
else {
1;
}
</placeholder state>

EDIT: It throws this error: SintaxError (unexpected end of imput)
you're missing a }
each { opened requires a closing } or it will cause errors.
you're missing a }
each { opened requires a closing } or it will cause errors.

Yeah, that's it! Now it works perfectly! Thank you very much for all your help. Have a nice day friend!
I can't get it to work. I just want that if the character has a state, when applying the same state, this state is removed and a new one is applied.

if (a.isStateAffected (1)) {
2;
}
más {
1;
}

If 1 is the poison state and 2 is poison+, when I apply state 1 it does not go to state 2. What am I doing wrong ... I don't understand.

Original thread: https://forums.rpgmakerweb.com/threads/himeworks-placeholder-states.107304/