A state nullifying other states?

Hello again.

Since a very long time I thought of a state, that -as long as it is active- negates the effects of certain other states without removing them, meaning that the other states remain on the target effectless but still count down etc.

An example:
-The target has the states "barrier", "Regen" and "Haste" active, and now the state "Curse" is added to these.
-The "Curse"-state has the effect to nullify the effects of all states with the state-category "positive", but it will not remove them.
-Now, the "barrier", "Regen" and "Haste"-states do not have an effect anymore, but they still count down until they run out.
-But if the "Curse"-state is removed while the other states are still active, they will gain their effects back.

My questions are now:
Can this be done in a way? (I use the YEP-library ^^)
And is this possible on states that have their effects not defined by notetags but only within the traits-section?

Note:
I could emulate such effect on 3 states by using this code (the red lines) found in one of YanFly's videos, but it does not work on all states and I am sure that there might be a better solution than this.
Spoiler
Code:
<Custom Confirm Effect>
if (!user.isStateAffected(5)) {
  if (this.isSkill() && user.skillMpCost(this.item()) > 0 && this.isMagical() && value !== 0) {
  value = Math.ceil(value * 1.50);
  user.removeState(45);
  }
}
</Custom Confirm Effect>

I am grateful for any help and suggestions I may get on this
Thank you 🙂

Original thread: https://forums.rpgmakerweb.com/threads/a-state-nullifying-other-states.105205/