[Ace] Help with Tsukihime's Conditional States

The tutorial provided with the script states the following:

Assuming you have two states Weak Poison (12) and Strong Poison (13), you can
create a conditional state (14) that will add Strong Poison if Weak Poison is
already applied, or apply Weak Poison otherwise.

<conditional state>
if a.state?(12)
13
else
12
end
</conditional state>

However, the above only works with two states. I would like to use this script to make a conditional state that "stacks" five times. For example: On the first usage of a skill, "State 1" should be applied, then on the second usage, if state 1 is on the target, "State 2" should be applied, then on the third usage, if State 2 is on the target, "State 3 should be applied and so on until "State 5" is reached. I attempted to accomplish this on my own, but would get an error when I tried to apply the state in battle. Can anyone provide assistance?

Link to the script: http://himeworks.com/2014/01/conditional-states/
How did you try to accomplish that? It should be quite simple with elsif:

Code:
if a.state?(15)16elsif a.state?(14)15elsif a.state?(13)14elsif a.state?(12)13else12end
How did you try to accomplish that? It should be quite simple with elsif:

if a.state?(15)16elsif a.state?(14)15elsif a.state?(13)14elsif a.state?(12)13else12end
This works perfectly, thank you.

Original thread: https://forums.rpgmakerweb.com/threads/ace-help-with-tsukihimes-conditional-states.39299/