Making a damage undead ability. (MV)

I'm trying to create a skill that would damage "undead" but not damage regular enemies. My first thought was to just reduce undead enemy's holy resistance by a lot, but this wouldn't stop the spell from damaging regular enemies. My second thought was to add another type of element with the same name "holy" but only use it on this spell and make every other monster immune to that skill. This WOULD work, but would also require me to go through every single enemy in the game and make them immune to that skill.

So I'm wondering if there is a way to go about this that I'm just overthinking, or if there is possibly an addon that could do this. Possibly something with yanfly's auto passive states? I'm not sure~
Give all non undead enemies a o% dmg rating to whatever is your anti undead's skill element.
Give all non undead enemies a o% dmg rating to whatever is your anti undead's skill element.
Yeah, that would work on them, but I'd still need to go through every non undead enemy in the game and make them immune to it, which was what I was trying to avoid having to do since I have so many enemies.
It's literally just copy pasting a single attribute xD The only way around this is knowing what you need beforehand, not after you already made hundreds of enemies apparently.

Even if you wanted to use state, that still requires you do add that state to all non undead enemies. NO way around it.
It's literally just copy pasting a single attribute xD The only way around this is knowing what you need beforehand, not after you already made hundreds of enemies apparently.

Never say "X is the only way to do Y" in RPG Maker; it will almost always be wrong.

Assuming you have considerably fewer undead than normal enemies, and therefore editing the database for all undead enemies is a lot quicker than editing the database for all normal enemies, you could give all your undead maxMP ending in 9, and then put this in the damage formula:

b.mmp % 10 === 9 ? {calculate damage} : 0

Or store your "is this enemy undead?" check in use some property, like Luck or TRG (if you don't have TP), that isn't being used for anything else, or in a modulo check somewhere else where tiny tweaks to a value won't really matter (give all your undead cev = 4 instead of 5 or whatever).

The "cleanest" (as in, no side effects at all) solution would be to use enemyId() and give all your undead IDs with a common property (e.g. all undead have IDs over 100), but that would also require having the foresight to set it up in advance.
You could also make the skill itself have a 0 for the damage formula and put a passive state on just your undead enemies that has the actual damage formula there.

Hits the undead for whatever you say, does 0 to everything else. Only have to edit the undead ones (and that can be a copy/paste).
You could make the skill do negative damage (so it heals "living"). Then have undead enemies set to negative amounts of its element rate.

I actually don't know if this works. RPGM has some unnecessary safeguards in it that hates funny numbers.
Maybe you could check this out if you're using some Yanfly plugins.

You could make the skill do negative damage (so it heals "living"). Then have undead enemies set to negative amounts of its element rate.

I actually don't know if this works.
It doesn't, there is a basic check (which you may consider unnecessary 😉) that prevents damage from being less than zero. That way an additive formula can't end up healing targets with a high defense.

Maybe you could check this out if you're using some Yanfly plugins.
That could be a good addition for a game that has undead, but it is different than what the OP was asking to do.

@KawaiiKid I stand by my prior suggestion; the other thing you could do, if you like the UX of it, is use Yanfly's Selection Core to prevent the user from using the skill at all on non-undead targets.

I've moved this thread to MV Support. Thank you.

It doesn't, there is a basic check (which you may consider unnecessary 😉) that prevents damage from being less than zero. That way an additive formula can't end up healing targets with a high defense.
I guess I forgot about basic subtraction formulas like that (even though I used one in my previous game, heh) . But it still sucks that you can't remove these training wheels without a plugin. I mean, you can easily use some javascript in your damage formula to prevent less than zero scenarios, too.

They also don't let you set any attribute to 0 without using a plugin. Which I assume is to prevent divide by zero from being a possible result. Bah!

Original thread: https://forums.rpgmakerweb.com/threads/making-a-damage-undead-ability-mv.152454/