Damage formula help:

I'm not sure how to make this formula work:

If target has state(1) and state(2) -> give target state(3); If (target has state(1) -> Give target state(2); Damage formula

It should give target state 3 if they are inflicted by both state 1 and 2, but if the target is only affected by state 1, it should give the target state 2.
Something like this?

JavaScript:
if (b.isStateAffected(X) && b.isStateAffected(Y)) {b.addState(Z); FORMULA} else if (b.isStateAffected(X)) {b.addState(Y); FORMULA} else {FORMULA}

X = State 1
Y = State 2
Z = State 3

FORMULA: your damage formula
Thanks, I've tested it under a few different conditions and I think it's working as it should with that.

Original thread: https://forums.rpgmakerweb.com/threads/damage-formula-help.129937/