Multiplying damage based on multipule states

Is there a way to multiply damage if the target has state (n) through state (n+x) in the damage formula? Basicly an attack that deals more damage if the target has a good status of any kind
Do you want the damage boost to be stackable? or damage is boosted when at least you have one of those states?
damage is boosted when at least you have one of those states?
This
Ruby:
your_damage_formula * (((n..(n+x)).any? { |state_id| b.state?(state_id) }) ? your_multiplier : 1)
This in a damage formula should do what you are looking for. I wrote this from mobile so the syntax can have errors.
thanks for the help! and thank you both @TheoAllen and @Heirukichi for responding

Original thread: https://forums.rpgmakerweb.com/threads/multiplying-damage-based-on-multipule-states.123022/