Add damage state

I'm working on a project and I was trying to figure out what type of formula to use to make an enemy susceptible to damage.

Example:

Actor does an attack that does 20 damage and inflicts state to enemy.

Now when same actor does same attack it now inflicts 30 damage to that same enemy

This is probably a really simple formula but I'm having a hard time figuring it out.
If x is the Id of the state you want to check:

JavaScript:
20 + (b.isStateAffected(x) ? 10 : 0)

b represents the target of the skill. isStateAffected returns true if the battler it's called on has a state with that Id. That line is a ternary (an inline conditional statement) that says, "If the target has a state with Id x, then use the value 10. Otherwise, use 0." You're adding that value to 20.
Try this one out. replace the X with the ID of the state that amplifies the damage.
Of course you can also replace the 20 and 30 with any damage formula of your liking
(I just took the numbers from your example.)

Code:
if (b.isStateAffected(X)) { 30 } else {b.addState(X); 20 }
Awesome! Thanks. I would have been having a few issues trying to figure it out. I appreciate the formula. I will play around with it to figure it out.

Original thread: https://forums.rpgmakerweb.com/threads/add-damage-state.122690/