MZ Immunities do not work with the Elements and Status Menu Core (VisuStella)

Hi, so in my project I wanted the earth element to be completely immune to electric attacks. Something I could do without this plugin, but I used it for convenience (of course, without actually having the earth element, just being immune to electric attacks).
The thing is, I've noticed that while there is a reduction, there's always a minimum amount of damage. Which I don't want.
I already tried removing the element core and setting the damage to 0% in vanilla, and then the damage was 0.
So... I tried using the notetags to reduce damage of all types (flat, rate, and plus), both individually and all three together, using the weakness manager within the plugin, and using the base element rate from RPG Maker. And it ALWAYS stays at the same number.

I also tried downloading the plugin again, in case I accidentally changed something I shouldn't have, and reverting to the base settings, but it's still the same, so I guess this is normal for the plugin?

I even tried changing something here, but I don't know much about it. Does anyone with this plugin have immune enemies? Or can anyone tell me what I can change?

[ISPOILER]
Captura de pantalla 2025-10-31 160659.png
[/ISPOILER]
Greetings,

I use Visustella's ElementStatusCore, so I will try and help here, but I think I'm going to need you to provide more info. 🙂

Just to be sure, I set an enemy's element rate to 0% as a trait on the enemy, and they take 0 damage, as expected.

I then removed the trait and gave an enemy the notetag <Received Element 2 Rate: 0%> and they take 0 damage, again as expected.

So I don't think there is a bug with the plugin at first glance, it's probably something you have changed in the plugin parameters or entered incorrectly in the notetag box.

I will need to see the entire panel for your enemy, actor, whatever that has the notetags in order to help you further.

Or, if you have modified the JS in the plugin parameters, i'll need to see the JS you added or changed. Not just a pic of an open window with the options displayed, but what you actually changed within one of those options.

Cheers,
-Niniann
Greetings,

I use Visustella's ElementStatusCore, so I will try and help here, but I think I'm going to need you to provide more info. 🙂

Just to be sure, I set an enemy's element rate to 0% as a trait on the enemy, and they take 0 damage, as expected.

I then removed the trait and gave an enemy the notetag <Received Element 2 Rate: 0%> and they take 0 damage, again as expected.

So I don't think there is a bug with the plugin at first glance, it's probably something you have changed in the plugin parameters or entered incorrectly in the notetag box.

I will need to see the entire panel for your enemy, actor, whatever that has the notetags in order to help you further.

Or, if you have modified the JS in the plugin parameters, i'll need to see the JS you added or changed. Not just a pic of an open window with the options displayed, but what you actually changed within one of those options.

Cheers,
-Niniann

Thank you so much! Here's a screenshot of the enemy (some parts are in Spanish, but Electrico is electric). I also tried setting it as ground, but I removed that setting at a certain point.
And what is JS? English isn't my native language, but regarding the configuration, I only used elements and sub-elements. I even tried with just the default plugin activated without any changes, but even then, the default element rate of 0% , still does damage.
I can still send it to you, I'm just not sure what JS is.
Captura de pantalla 2025-10-31 173037.png
Captura de pantalla 2025-10-31 173045.png
And what is JS
Javascript. It's the coding language for MV and MZ. Many plugins have parts that let people familiar with code do custom things.

I even tried with just the default plugin activated without any changes, but even then, the default element rate of 0% , still does damage.
This is a bit of guesswork, but does your actor, or their class/equipment/states have any notetags to increase their electric damage? I don't use VS plugins, but If the VS plugin does the same thing the Yanfly version did in MV then those notetags directly adjust the element rates used in damage calculation and would allow a target immune to an element to still take damage from it.
Javascript. It's the coding language for MV and MZ. Many plugins have parts that let people familiar with code do custom things.


This is a git of guesswork, but goes your actor, or their class/equipment/states have any notetags to increase their electric damage? I don't use VS plugins, but If the VS plugin does the same thing the Yanfly version did in MV then those notetags directly adjust the element rates used in damage calculation and would allow a target immune to an element to still take damage from it.
So you want me to give you the text de elements and sub elements?

And yes, it has one, since it's a tactical role-playing Pokémon fangame, so I use the deal to mimic STAB (in case you didn't know, Electric-type Pokémon increase damage by 50%, but it doesn't affect Ground-type Pokémon regardless).

Captura de pantalla 2025-10-31 180519.png
And yes, it has one
Yeah, I think that tag might be doing what the MV plugin did and is adding 50% to the target's element rate when calculations are being made. Maybe try <Dealt Element id Rate: 150%>?
Yeah, I think that tag might be doing what the MV plugin did and is adding 50% to the target's element rate when calculations are being made. Maybe try <Dealt Element id Rate: 150%>?
1761946325828.png

YEAH, it works!

Thank you so much <3
Edit: Well, I entered that and it's not giving a STAB, I probably entered it wrong, but hey, at least the immunities work. I just need to find another notetag or check if I entered it incorrectly.
<Dealt Element id Rate: 150%>?
Edit: Well, I entered that and it's not giving a STAB, I probably entered it wrong, but hey, at least the immunities work. I just need to find another notetag or check if I entered it incorrectly.
I didn't write the ID in, and you didn't show the notebox afterwards but you did replace the ID with 5 right?
<Dealt Element 5 Rate: 150%>
@Robro33 figured out what's going on here, so I'll see if I can help get this wrapped up 🙂.

You lost STAB but gained an immunity because you're no longer getting that +50%, so once you add that back in, you're going to lose the immunity again.

--------------

I think what you're going to need to do, to have both STAB and immunities using Visustella, is modify the math in JS: Finalize Rate within Element Rulings in the ElementStatusCore ->

// Declare Constants
const target = arguments[0];
const action = this;
const elements = action.elements();
const targetRate = action.calcTargetElementRate(target, elements);
const sign = targetRate >= 0 ? 1 : -1;
const base = Math.abs(targetRate);
const plus = action.calcUserElementDamagePlus(target, elements);
const rate = action.calcUserElementDamageRate(target, elements);
const flat = action.calcUserElementDamageFlat(target, elements);

// Determine Return Value
return sign * Math.max((base + plus) * rate + flat, 0);;

This is how it looks baseline I believe (I don't think I've made any modifications here, but I did rework some stat calculations elsewhere). If you modify the calculations here, you'll be able to get your elements working how you wish.

Try changing const sign = targetRate >= 0 ? 1 : -1; to this: const sign = targetRate; and seeing what happens.

--------------

I tested it on my end, and it works just how you would want it. Characters with +50% elemental damage do 0 damage to a character with an immunity, but keep that +50% otherwise. 🙂

NOTE:
If you make this change, I believe it probably will break Absorb Element mechanics (i.e. if something was supposed to absorb Electric damage to heal itself, this change might break that effect). This is because sign is no longer able to be assigned a -1 to reverse the damage.

Note2: If you want to know a little more about what I did here, I modified the calculation for sign so that it equals exactly to the Trait setting in the database, rather than have an if / else statement that was assigning a 1 to sign even if the Trait was set to 0%.
I didn't write the ID in, and you didn't show the notebox afterwards but you did replace the ID with 5 right?
<Dealt Element 5 Rate: 150%>
Yeah, I hadn't realized I was using the plus tag instead of the rate tag. And well, everyone was using the plus tag,
I already set the deal to 150% and everything is working as it should.
I also realized I was using the plus sign on all my characters, so I switched them all to deal. So you also saved me from potentially changing a LOT of notestag in the future.
@Robro33 figured out what's going on here, so I'll see if I can help get this wrapped up 🙂.

You lost STAB but gained an immunity because you're no longer getting that +50%, so once you add that back in, you're going to lose the immunity again.

--------------

I think what you're going to need to do, to have both STAB and immunities using Visustella, is modify the math in JS: Finalize Rate within Element Rulings in the ElementStatusCore ->

// Declare Constants
const target = arguments[0];
const action = this;
const elements = action.elements();
const targetRate = action.calcTargetElementRate(target, elements);
const sign = targetRate >= 0 ? 1 : -1;
const base = Math.abs(targetRate);
const plus = action.calcUserElementDamagePlus(target, elements);
const rate = action.calcUserElementDamageRate(target, elements);
const flat = action.calcUserElementDamageFlat(target, elements);

// Determine Return Value
return sign * Math.max((base + plus) * rate + flat, 0);;

This is how it looks baseline I believe (I don't think I've made any modifications here, but I did rework some stat calculations elsewhere). If you modify the calculations here, you'll be able to get your elements working how you wish.

Try changing const sign = targetRate >= 0 ? 1 : -1; to this: const sign = targetRate; and seeing what happens.

--------------

I tested it on my end, and it works just how you would want it. Characters with +50% elemental damage do 0 damage to a character with an immunity, but keep that +50% otherwise. 🙂

NOTE:
If you make this change, I believe it probably will break Absorb Element mechanics (i.e. if something was supposed to absorb Electric damage to heal itself, this change might break that effect). This is because sign is no longer able to be assigned a -1 to reverse the damage.

Note2: If you want to know a little more about what I did here, I modified the calculation for sign so that it equals exactly to the Trait setting in the database, rather than have an if / else statement that was assigning a 1 to sign even if the Trait was set to 0%.
And thank you for taking the time, and sorry for not writing sooner and that you had to take the time for that.
Yeah, I hadn't realized I was using the plus tag instead of the rate tag. And well, everyone was using the plus tag,
I already set the deal to 150% and everything is working as it should.
I also realized I was using the plus sign on all my characters, so I switched them all to deal. So you also saved me from potentially changing a LOT of notestag in the future.

And thank you for taking the time, and sorry for not writing sooner and that you had to take the time for that.
All good, I help out because I learn things from helping others on top of it being fun to do so, and I've never messed with those element calculations before. Got some new techniques I can use now 😀.

Glad you got it figured out, and best of luck with your project 🙂.
Yeah, I hadn't realized I was using the plus tag instead of the rate tag. And well, everyone was using the plus tag,
I already set the deal to 150% and everything is working as it should.
just to explain it a little, the default formula is:
Code:
(base + plus) * rate + flat
Increasing plus works fine if the target's element rate is 100%, but since the plus is added to the base, it stops being accurate in every other scenario.

A target with 0% base takes 50% of the base damage as that's 0% +50%. Another electric type that should only take half damage from electric would take full damage from STAB as it's 50% + 50% instead of 50% * 150% = 75%, while something like Gyarados that'd have a 400% base would have an effective 450% element rate on STABs instead of 600%.

What you wanted was a multiplicative factor, which was already provided by rate.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/immunities-do-not-work-with-the-elements-and-status-menu-core-visustella.180799/