Attack that deals Hp and Mp damage, help!

Hello, i've just started using RPG Maker and I having a few problems.
The first one that I've encountered is that I don't know how to create an attack that deals both hp and mp damage, you know, that reduces the life and the magic of the opponent.

I've been reading about damage formulas , and I though that this one would do the trick:

a.atck*4 - b-def*2; b.mp -= (a.mat*4 - b.mdf*2)

But the program only seems to deal the HP damage. For what I've been reading that would be a formula for RPG Maker VX but not for RPG Maker MV.

Can somebody please help me?

Thank you in advance.
Can you achieve what you want by adding an Effect of "Recover" but just enter a negative value in the boxes provided for MP? They have a static value there and a % value as well.

The standard program is pretty bare bones in how it handles combat mechanics as I seem to see people say. Thankfully tons of plug ins abound that help mitigate the blandness and will help set your game apart from the basic editor limitations.
It worked! Setting the % value to 0 and introducen a negative value. The problem is that this way the value would be always the same but it's a start.

Thank you so much!
The 0% can also go negative I believe. I don't know I never really messed with any of that yet. I'm trying to do other things with the engine that seem like it was built to do and do quite well. I would only assume this would be a fully supported feature, but I'm wrong about a lot of things meow.
If you haven't heard of him, Yanfly has an amazing website with a SLEW of Rpg Maker MV plug ins, and a tutorial in how to set them up for them.
He talks about where you need to have them in the plug-in list, and also how to customize the features within the plug in window. www.yanfly.moe
I'm close to releasing a new plugin that might help. It allows you to create any number of additional HP attributes you'd like. Because of this, I had to devise a way to let you define formulas that can damage or heal any or all of them however you need.

All of the other functionality it has is a bit overkill but maybe you'll find use for it. Keep an eye for FROG Health in the plugin releases forum. It'll be worth checking out, at least.
You should be able to just do it in the damage formula. Just keep in mind that value for the damage needs to be the last thing in the fomula.

I can't test it right now, but see if this works:
Code:
b.gainMp(-(a.mat*4+b.mdf*2)); a.atk*4-b.def*2
with the Type set to HP Damage.

Also, a good guide for Damage formulas in MV specifically is this one: https://www.rpgmakercentral.com/topic/36290-damage-formulas-101-mv-edition/
Code:
b.gainMp(-(a.mat*4+b.mdf*2)); a.atk*4-b.def*2
with the Type set to HP Damage.

LadyBaskerville big thanks~ I just tested the formula and it works perfectly for those that need a skill damaging both HP & MP.
If you set Type to MP Damage it will just damage the MP though which is what I needed.
Really helpful!
And hope this isn't a necropost~

Original thread: https://forums.rpgmakerweb.com/threads/attack-that-deals-hp-and-mp-damage-help.94681/