How to make skills/magic that nullify element resistance in battle

I'm trying to work out how to use skills/magic to nullify any resistances an actor or enemy may have for a certain number of turns, allowing them to be damaged by an element they would otherwise suffer no damage from.

For instance, an enemy is immune to Fire, but I want to be able to use a skill on said enemy that makes their fire resistance go away for a certain number of turns.

I tried making a skill that inflicts a state that will make an enemy take normal damage from Fire (set Element Rate to 100%), but this didn't affect anything and the enemy was still immune to fire.

I believe I may need a script for this, saw something script related that was done for MV for a similar issue, but I'm working in VX Ace, and I need a solution, scripting or non scripting related, that will do what I need as stated above.
The way I did it was to make a "state" that governs the enemy's elemental resistance (with no icon, so the player doesn't see it), and then manually apply the state at the start of battle using Troop events. Then, you can have your erasure skill set to remove all of those types of states as a special effect. 👋
The way I did it was to make a "state" that governs the enemy's elemental resistance (with no icon, so the player doesn't see it), and then manually apply the state at the start of battle using Troop events. Then, you can have your erasure skill set to remove all of those types of states as a special effect. 👋

That's an idea, but I already have troop event for a default talk event set up for all enemies and that might cause issues with said talk event.

Well, I could set one up on a separate page to get around this tied to certain conditions, but I'd prefer to not have to set up something for every enemy troop, unless there is no simpler solution.
Here, a hardcoded solution
Code:
class Game_BattlerBase
  alias mod_ele_rate element_rate
  def element_rate(element_id)
    return [mod_ele_rate(element_id), 1.0].max if state?(<STATE ID HERE>) && element_id == <FIRE ELEMENT ID HERE>
    return mod_ele_rate(element_id)
  end
end
If you want this to work universally across all the elements. Put # in front of &&
Here, a hardcoded solution
Code:
class Game_BattlerBase
  alias mod_ele_rate element_rate
  def element_rate(element_id)
    return [mod_ele_rate(element_id), 1.0].max if state?(<STATE ID HERE>) && element_id == <FIRE ELEMENT ID HERE>
    return mod_ele_rate(element_id)
  end
end
If you want this to work universally across all the elements. Put # in front of &&

Ok, that will work, though I take it I'll need to set up the same thing for every element I have a "null resistance" state for, correct?

Also, how would I set this up if my "Fire Break" state is my third state, and Fire is my fourth element?

If possible, a game demo would be ideal for showing how this would work, especially with different elements.
Ok, that will work, though I take it I'll need to set up the same thing for every element I have a "null resistance" state for, correct?
My example is for a specific element. But I already said that if you want it to work universally, you have to put # before && symbol.
It does not make specific "null resistance" to be removed. Null resistance means 0% element damage rate, I simply make the minimum element rate is 100%. So even resistance like 50% (not completely null) will be back to 100% element rate.

Also, how would I set this up if my "Fire Break" state is my third state, and Fire is my fourth element?
Change <STATE ID HERE> to 3, and <FIRE ELEMENT ID> to 4, if that is what you mean.

If possible, a game demo would be ideal for showing how this would work, especially with different elements.
It's too trivial to make a game demo for this snippet though.
My example is for a specific element. But I already said that if you want it to work universally, you have to put # before && symbol.
It does not make specific "null resistance" to be removed. Null resistance means 0% element damage rate, I simply make the minimum element rate is 100%. So even resistance like 50% (not completely null) will be back to 100% element rate.


Change <STATE ID HERE> to 3, and <FIRE ELEMENT ID> to 4, if that is what you mean.


It's too trivial to make a game demo for this snippet though.

That clears up my questions, I should be able to handle it from here.

Found a possible alternative solution if this doesn't work too.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-skills-magic-that-nullify-element-resistance-in-battle.105234/