Conditional state/debuff immunity

I'm trying to simulate a type of magic immunity by making a particular player character immune to states/debuffs triggered by magical skills (but still be affected normally by non-magical effects such as a poisonous attack from say...a giant snake).

Anyone aware of a way to make that happen?
If I understand correctly, you should be able to have this by going into the character's traits in the database and under the box to the right opt-in to make them immune or even more acceptable to certain states. This should provide you with what you want where the state will be immune but they should still take any damage or additional states if given by the skill/ability.
Well, it's a bit excessive to do, but you could make duplicates of all your states and debuffs, making one copy of each the magic triggered version. Then just give your character state resist traits for the magic triggered versions.

I've not tried this myself, but maybe it'll work.
If I understand correctly, you should be able to have this by going into the character's traits in the database and under the box to the right opt-in to make them immune or even more acceptable to certain states. This should provide you with what you want where the state will be immune but they should still take any damage or additional states if given by the skill/ability.
Wouldn't work. He's saying if a spell makes you bleed, you negate the damage from the spell AND negate the bleed but if a warrior slashes you with a sword and makes you bleed, you receive the damage and the state of bleed.


Well, it's a bit excessive to do, but you could make duplicates of all your states and debuffs, making one copy of each the magic triggered version. Then just give your character state resist traits for the magic triggered versions.

I've not tried this myself, but maybe it'll work.

^This is the work around though I'm sure someone can come up with JS plugin that'll specifically help with your request especially since if you want to have an ally immune to fire and let's say there is a fire spell that decreases defenses, making duplicate states can have you run into a situation where that 1000 state limit could catch up pretty quickly
Hello, this can be acheived with Yanfly Buff States Core.
Create a 'magic resist' state and put these notetags in it:
Code:
<Custom React Effect>
  if (this.isMagical()) {
    value = 0
  }
</Custom React Effect>
<Custom Deselect Effect>
  if (this.isMagical()) {
    let s = target.result().addedStates
    for (let i in s) {
      target.removeState(s[i])
    }
    let d = target.result().addedDebuffs
    for (let i in d) {
      target.eraseBuff(d[i])
    }
  }
</Custom Deselect Effect>
Should behave as you asked.
Thanks, I'll give that a try!

Original thread: https://forums.rpgmakerweb.com/threads/conditional-state-debuff-immunity.117731/