can skill effects be mutually exclusive?

basically what the title says. can a skill have two possible effects that can't happen simultaneously? for example, could an attack be able to burn or freeze an enemy but not apply both effects at the same time, or could there be a healing move that cures one status effect at random but can't cure two or more in one go?
you might need to have the skill call up a common event in both of those situations.
Here is something you could try:

JavaScript:
if (Math.randomInt(2)  === 1 && b.isStateAddable(X) && !b.isStateAffected(X)) { b.addState(X); Z } else if (b.isStateAddable(Y) && !b.isStateAffected(Y)) { b.addState(Y); Z }

put this into the damage formula for your skill and change the variables.
x = state ID (burn for example)
y = state ID (freeze for example)
z = possible damage formula (leave blank if skill does no damage)

Similarly for your state-removal skill:

JavaScript:
if (Math.randomInt(2)  === 1 && b.isStateAffected(X)) { b.removeState(X); Z } else if (b.isStateAffected(Y)) { b.removeState(Y); Z }

z = possible healing
Here is something you could do:

JavaScript:
if (Math.floor(Math.random()*2)+1 === 1 && b.isStateAddable(X) && !b.isStateAffected(X)) { b.addState(X); Z } else if (b.isStateAddable(Y) && !b.isStateAffected(Y)) { b.addState(Y); Z }

put this into the damage formula for your skill and change the variables.
x = state ID (burn for example)
y = state ID (freeze for example)
z = possible damage formula (leave blank if skill does no damage)

Similarly for your state-removal skill:

JavaScript:
if (Math.floor(Math.random()*2)+1 === 1 && b.isStateAffected(X)) { b.removeState(X); Z } else if (b.isStateAffected(Y)) { b.removeState(Y); Z }

z = possible healing

You can simplify this a bit by using Math.randomInt(2) instead; it's a wrapper function added to the core MV code so you don't have to mess around with random() when you want an integer.
@Trihan Oh that's good to know and a lot more compact than the abomination that is "Math.floor(Math.random()*2)+1"
Yeah, it's one a lot of people haven't noticed yet as it wasn't well-documented as a thing. 🙂
Wait a second here, I just noticed that OP is using RMVXA.
So my solution would not work either way. :LZSlol:
the code itself would not work if it was written for RMMV (javascript), but the principle itself will work if the OP uses the equivalent RGSS-commands for RMVXA.
The main thing is that you'd have to extract that code into a new Battler method and call it from the damage formula because what you've written won't fit in the box.
I think it can be shorter than that using a ternary operator.
Code:
b.add_state(rand < 0.5 ? frost_state_id : burn_state_id); a.atk*4 - b.def*2

You can change the default a.atk*4 - b.def*2 formula to any formula you want.

Similarly, you can use the ternary operator to clean negative effects, the call should be remove_state instead of add_state.

This should be short enough to fit in your formula box.

Original thread: https://forums.rpgmakerweb.com/threads/can-skill-effects-be-mutually-exclusive.124272/