Trying to do a damage formula that checks the targets class first...

Essentially, I'm trying to make a buff skill that when used on a party member, gives them a state that's specific to their class. I tried doing this in the damage formula:

Code:
b.isClass(2)?b.addState(225):b.isClass(3)?b.addState(226):b.isClass(4)?b.addState(227):b.isClass(5)?b.addState(228):b.isClass(5)?b.addState(229):b.isClass(8)?b.addState(230):b.isClass(9)?b.addState(231):b.isClass(10)?b.addState(232):b.isClass(11)?b.addState(233):b.isClass(14)?b.addState(234):b.isClass(15)?b.addState(235):b.isClass(16)?b.addState(236):b.isClass(17)?b.addState(237):b.isClass(20)?b.addState(238):b.isClass(21)?b.addState(239):b.isClass(24)?b.addState(240):b.isClass(25)?b.addState(241):b.isClass(26)?b.addState(242)

It throws an error when I use it in-game, citing the entirety of the battle formula. Perhaps not very surprising, considering the battle formula is one basic thing repeated numerous times.

Still, it's the gist of what I'm trying to accomplish and I'd love any help I can get on the matter.

I confess that I've never did anything like this, but it's supposed to be one big string of else-if's, where it applies, just for sake of example, State 1 if the targets Class is 1, if not, it applies State 2 if the targets class is 2, if not, it applies State 3 if the targets class is 3, etc. etc.

I did some googling on it and found plenty of examples on handling an else statement, but less so on how to go about handling else-if's which I assume would be necessary for this.

Thanks for reading.
My thought is it would probably be better to do that in an action sequence instead of a damage formula...
My thought is it would probably be better to do that in an action sequence instead of a damage formula...

I have the Action Sequences plugin and I'm somewhat familiar with it, but am not sure how to go about accomplishing what you're proposing. Probably pretty dumb, but could you give me a snippet or something to work with? I would greatly appreciate it, man. I'm totally down with using Action Sequences.
<target action>

if target.isClass(1)

add state: 1

else if target.isClass(2)

add state: 2

end

</target action>

Something like that

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-do-a-damage-formula-that-checks-the-targets-class-first.85182/