State combos (Sleep + Curse = Nightmare)

I was wondering, how do I go about the possibility of making state combos? As the title says, I wanted to make it so that, when the target is already asleep (Sleep state) and is affected by a Curse state (darkness element), both of these states would be removed and replaced by the Nightmare state.

So,
Target (with Sleep state) = incapable of acting and reduced defenses, but wakes up on certain percentage of damage.
+
Target (with Curse) = receives percentage HP damage per turn.
=
Target (with Nightmare) = incapable of acting and reduced defenses; receives percentage damage per turn; does not wake up regardless of damage taken.

Do I have to use common events every time I use a skill that can apply Sleep or Curse? Or is there a way to automatically check if two states are applied to a target? This should go for both enemies and heroes.

I'm also currently using state levels (Sleep I, Sleep II, Sleep III - same for Curse) that increase the effect of each state (magnitude or duration). I can easily remove lesser levels when applying a stronger one, but I wonder if it's possible to create a condition for state combos while considering this level system.

Spoiler
This means that the condition to apply Nightmare could be any of the following:
Sleep I + Curse I
Sleep II + Curse I
Sleep III + Curse I

Sleep II + Curse II
Sleep II + Curse III

Sleep III + Curse II
Sleep III + Curse III
Do I have to use common events every time I use a skill that can apply Sleep or Curse? Or is there a way to automatically check if two states are applied to a target? This should go for both enemies and heroes.
you can use the same event, using several conditions.
you'll need some script calls to grab the various states if you can't do that through the conditional, but yes, it's possible.

what you need to apply Nightmare is a binary validation: either "yes, it's possible", or "no, it isn't".
that validation can come from anywhere else, as long as the product of those other conditions boils down to "yes" or "no".
so, you can process something like "take this effect whatever it is", "find any of *these* effects in target", "is *this* effect and *this* state combination valid?".
you can use the same event, using several conditions.
you'll need some script calls to grab the various states if you can't do that through the conditional, but yes, it's possible.

what you need to apply Nightmare is a binary validation: either "yes, it's possible", or "no, it isn't".
that validation can come from anywhere else, as long as the product of those other conditions boils down to "yes" or "no".
so, you can process something like "take this effect whatever it is", "find any of *these* effects in target", "is *this* effect and *this* state combination valid?".
I'm not really familiar with the type of script calls that could be used in this situation. What would they be? And if I go for the common event, I assume I have to use a variable to get the hero/enemy's id somehow?

By the way, I seem to have found a script that could do this. It's Victor's State Auto Apply (plus State Cancel could be used too), but I can't get it to work. I attached a screenshot of the notetag, I tried putting it on the Actor notes, on the Skill notes and on the Class notes, but nope, nothing. Maybe I'm missing something? I do have the Basic Module installed as well.
I'm sorry to bump this thread, but I still need help with this. Couldn't figure it out by myself.

Original thread: https://forums.rpgmakerweb.com/threads/state-combos-sleep-curse-nightmare.129930/