MV Action Sequence Conditional Branches - State check

Hi all,

I hope this is the right board for this particular question. I'm having trouble finding success with a particular sequence of conditonal branches in my action sequence. It seems that using the skill in question will not apply the state I intend it to (state 58).

Would someone be able to look over this for and see if there's anything obviously wrong?

Code:
if target.isStateAffected(61)

target.addState(62)

target.removeState(61)

end

if target.isStateAffected(60)

target.addState(61)

target.removeState(60)

end

if target.isStateAffected(59)

target.addState(60)

target.removeState(59)

end

if target.isStateAffected(58)

target.addState(59)

target.removeState(58)

end

if !target.isStateAffected(58)

if !target.isStateAffected(59)

if !target.isStateAffected(60)

if !target.isStateAffected(61)

if !target.isStateAffected(62)

target.addState(58)

end

end

end

end

end

What it's trying to do, is "escalate" the state each time the skill is used on the same target with the pre-existing state. If no states are currently applied to the target, it is supposed to apply state 58. Is there anything in this segment that stands out as wrong? Because it's not working.

Let me know if you see anything!


Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/action-sequence-conditional-branches-state-check.129655/