Damage formula help (extra damage / add state)

So the formula I'm trying to work is like this: if enemy has Bleed: deal +20% damage, otherwise, inflict Bleed (on top of regular attack damage). I had a similar formula somewhere in my MV game, but copying it over to MZ and editing the details leaves the skill doing no damage, and not inflicting Bleed. What I currently got:

if (b.isStateAffected(22)); {(a.atk*1.2*v[1285]/100)}; else {b.addState(22); (a.atk*v[1285]/100)}
I'm reasonably sure that that never worked in MV either, because it has too many ; breaking the commands in the wrong positions.
A semi-colon ; ends a statement in JavaScript. Don't use them to split parts of an if...else block! Your current formula will cause an error and return 0.

Try this instead:
JavaScript:
if (b.isStateAffected(22)) { a.atk * 1.2 * v[1285] / 100 } else { b.addState(22); a.atk * v[1285] / 100 }
I see, that version works perfectly. 👍
I think you need a semicolon to close out the eclipse section right before the else statement... " 100; } else“. .. But if it's working, don't break it.

Original thread: https://forums.rpgmakerweb.com/threads/damage-formula-help-extra-damage-add-state.131601/