Multiple if statements and states in a single skill?

Is something like this possible?

example:

if stateA, atk*2, addStateB;
if stateB, atk*3, addStateC;
if stateC, atk*5, addStateC;
else, atk*1, addStateA;

I know you can do ifStateAffected, addState; atk*x and a single if/else but is it possible to do it multiple times and what would the formula look like?

Edit:
I figured it out. It looks like this:

if(a.isStateAffected(1))
{
a.addState(2);
a.atk*2;
}
if(a.isStateAffected(2))
{
a.addState(3);
a.atk*3;
}
else
{
a.addState(1);
a.atk*1;
}

Edit:
Bug. I use the skill once, it adds the first state fine but on my second turn when I use the skill again it adds states 2 and 3 at the same time for some reason. I don't know why.

Edit:
I changed the second if to else if and it works fine.
Can somebody whoever has the ability delete this?

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.


We actually prefer to close them instead of delete them in case someone else later has the same question. This way they can find your solution you posted.

Original thread: https://forums.rpgmakerweb.com/threads/multiple-if-statements-and-states-in-a-single-skill.83198/