DMG Formula affected by multiple states?

How would I make the formula damage determined by multiple states, but then if the target isn't affected with debuffs, it does less damage? I'm currently experimenting with:
b.state?(X,X,X)? a.mat * Y : a.mat * Y

but it's doing nothing right now if the enemy has the states, so it's probably just my formula.
Does the formula only work if the target has *all* of these states? How would I make it so that any of these states will increase damage?

Would appreciate any help!
The state? method only takes one parameter. If you want to text more parameters, I recommend using the array all? method.

The result would be something like this:
Code:
[state1, state2, state3, ... , stateN].all? { |state_id| b.state?(state_id) } ? a.mat * X : a.mat * Y
Hmmm something isn't working for some reason. I wrote it as it is in the formula section. Is that for MV, because I'm currently using VXA for this, and I don't know if they are different in the formula section.
Hmmm something isn't working for some reason. I wrote it as it is in the formula section. Is that for MV, because I'm currently using VXA for this, and I don't know if they are different in the formula section.
It's for VXA and if it's working, you should post your formula here. Maybe there's a syntax error somewhere in your formula.
It's for VXA and if it's working, you should post your formula here. Maybe there's a syntax error somewhere in your formula.

What does the state N do in the formula? I think that's the part that's confusing me because I left the ... and the stateN in there.

This is what I'm experimenting with rn
[61, 62, ... , stateN].all? { |state_id| b.state?(state_id) } ? a.mat * 2 : a.mat
The notation a, b, ... , n is commonly used in math when you have a variable number of elements that has not been specified, you can think of it as a placeholder. You have to replace that with the elements you need (in your example that would be [61, 62]).
teN].all? { |state_id| b.state?(state_id) }

I seem to be running into an error even with a fresh project, but it's probably because I'm writing it wrong still. ;_; I have the formula written as: [61, 62].all? { |state_id| b.state?(state_id) } ? a.mat * 12 : a.mat
Wkxr8nA.png
Well, the error notice suggesting that you write
Code:
[61, 62].all? a.mat * 12 : a.mat
instead of
Code:
[61, 62].all? { |state_id| b.state?(state_id) } ? a.mat * 12 : a.mat
Well, the error notice suggesting that you write
Code:
[61, 62].all? a.mat * 12 : a.mat
instead of
Code:
[61, 62].all? { |state_id| b.state?(state_id) } ? a.mat * 12 : a.mat

That's really weird, because I just copied and pasted the same thing, but it doesn't show up on the error. Let me try recreating it.

Edit: I got it fixed now it's working! For some reason, the parenthesis and brackets weren't being copied, but now it's fine. Thank so much for the help
Thread closed a

Original thread: https://forums.rpgmakerweb.com/threads/dmg-formula-affected-by-multiple-states.119153/