MP Damage Questions

Hey all, I've got two questions related to dealing MP damage to a target:

1) How would I go about making skills which simultaneously deal HP and MP damage?

2) This case isn't directly related to the first, but let's say I want to make a State which adds MP damage to a character's attacks. If the character has a skill which hits multiple times, is there a way to divide the MP damage which the State adds by the number of hits in the attack, so the total amount of MP damage is the same as it is for single-hit skills? Or is there another way to achieve the same effect?

I'm not averse to using plugins if need be. For case #2, I'll probably be using Hime's State Damage Modifiers plugin (http://himeworks.com/2015/11/state-damage-modifiers/) to design the State which adds MP damage. I just don't know how to implement the separate interaction with multi-hit abilities.

Thanks!
Still looking for answers to either of these questions. I'd appreciate any insight anyone has!
I'm pretty sure that there's a way to use a formula to deal damage to both HP and MP. I don't remember how that's written. If you want to go all-out on this concept, though, I made a plugin that not only let's you do this but also allows you to add extra HP stats to your game if you're interested. Because of the nature of such a plugin, dealing damage to multiple HP stats was a must. If what you ask is all you really want, my plugin is total overkill.

https://forums.rpgmakerweb.com/inde...tom-hp-in-your-game-demo-now-available.92623/
@Frogboy I've seen your plugin and I've been keeping it in mind for some other aspects of my game! I'm not ready to start work on those parts yet, but it seems like you've built a really versatile tool which could help with quite a bit later on.

Anyways, I managed to resolve my first question above with just the damage formula, as you suggested. The correct formula was:

b.gainMP(-(X));

...Placed directly in front of the normal HP damage formula, with the damage type set to HP Damage.

I actually solved my own second question as well, this time by using Yanfly's Action Sequences together with Hime's State Damage Modifiers. For anyone who's curious, here's what I did:

Spoiler
Since I'm using Yanfly's Action sequences for most of my skills, multi-hit skills have multiple instances of "action effect" written consecutively in the sequence. So what I did was create a dummy state, and then had the sequence add that state to the target in between action effects, like this:

<target action>
action effect: target
add state ID#: target
action effect: target
</target action>

Then the finish action segment of the sequence removes the state:

<finish action>
remove state ID#: target
</finish action>

With this set up, I made my "add MP damage to physical attacks" state and then customized it with the State Damage Modifiers plugin like this:

<state damage modifier: attacker>
if (this.isPhysical() && !b.isStateAffected(ID#))
{
b.gainMp(-(X))
return d
}
else
{
return d
}
</state damage modifier>

In the plugin's notation, "d" represents the normal damage of the attack. So the way it's set up, I can use action sequences to specify that any multi-hit attack will add my dummy state between the first hit and any subsequent ones (or at any other time I want), and my MP damage state will then stop dealing MP damage after the number of hits I specify. The regular damage of the attack continues to go through with each hit, however.

The one caveat is that using b.gainMp() won't factor in anything which modifies the value of the MP damage (e.g. damage variance, defense, guarding, etc.). I didn't want it to anyways, but for projects where that matters, a different command would be necessary.
Awesome, thanks!

:MV1:

Original thread: https://forums.rpgmakerweb.com/threads/mp-damage-questions.97394/