Have HP AND MP damage

I want to have a skill which damages both HP and MP.

What I have tried so far is to set the skill to HP Damage and then have this damage formula

b.result.mp_damage = (10 +a.mat - b.mdf); 120 + a.mat * 2 - b.mdf

What seems to happen is that HP damage is done, but MP is added to the target. Interestingly, if it is reflected back on the user, it does become both HP and MP damaging.

Clearly my approach is not the correct one. Does anyone have any suggestions?

Thanks
try accessing MP directly:

b.mp -= (10 + a.mat - b.mdf); 120 + a.mat * 2 - b.mdf
@Andar That formula just gives me HP damage and doesn't do anything either way to MP.
I'm not sure if it's conflicting with another script you're using, because I used that exact formula and it dealt MP damage, Kes. (the first one you posted)
@Trihan It's nice to know that my formula is correct, but if it is conflicting with something, then I shall have to drop the idea for that skill, because there's no way I'm going to be able to bug hunt my way to finding where the problem lies.
Can you archive your project and send it to me like you did last time and I'll take a look?
@Trihan Be prepared to be horrified when you see my script list.
But yes, I can do that.
Thank you.
Sorted it, check your PMs. 😀
Yay!!!
For anyone who has a similar problem -

The formula heals MP if the target has a higher MDF than the user has MAT. It needs a slight adjustment to prevent that happening
b.result.mp_damage = (10 + a.mat - b.mdf).abs; 120 + a.mat * 2 - b.mdf

Moderator note: Closing as solved.
Hi everyone- so I'm having a similar problem. I want to design a powerful attack that the final boss would use which halves everyone's HP and MP.

I tried with the forumals above but I somehow the MP damage didn't work. I saw that someone said it might be because of incompatiblities so i even tried turning off all my plugins and that didn't work.

But then I did this:

I entered HP damage, formula: b.hp/2 and then for effects I put recover MP -50%

The only problem was it wont SHOW the MP damage numbers in battle.

But then when I turned my plug-ins back on, Yanfly's Battle Engine Core took care of that problem 🙂

B_princess, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.



Plus this thread is for ACE, your solution is for MV.

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/have-hp-and-mp-damage.75537/