Absorb HP AND MP

I am trying to work out a skill which absorbs both HP and MP.  By default you can have one or the other, but not both, by selecting from the Damage Type drop down menu.  Does anyone know a cunning way of overcoming this limitation?  All I can think of is to add a call to a common event which does a force action on a second skill which absorbs one of them, but that does seem a bit dubious as a method.

Thanks.
You could add a script that looks for a tag in the note of the skill, and if found, does both.
I'm reluctant to add a script in just to do one skill if I can possibly avoid it - but if I can't, do you know a straightforward one which would do this?
No, I don't know any scripts that would do it, because, like you, I don't like adding scripts that are all-singing and all-dancing just for the sake of one feature.


If I wanted this, I would write a script that did this and nothing else. If you decide to go the script way because you can't figure out a good, easy non-script way, I suggest you make a request for a script to do exactly what you want and nothing else, and ignore all the "hey, this base engine with these 50 add-ons will do that" suggestions 😉
It seems to be plausible with just the formula box. Set the type to hp drain and use the following to add mp drain.

Code:
b.result.mp_damage = (mp damage formula); (regular formula)
Assuming the hp damage and mp damage are different values. If you wanted the same value, it would be something along the lines of:

Code:
d = (formula); b.result.mp_damage = d; d
@Yato

Just for the sake of clarity:

I would select the HP Drain from the drop down menu so that the engine knows to do that part, and then the formula you have suggested adds the MP bit.  

Is that correct?
My concern with that is all the other things that happen after the formula has been calculated - there's a variance, elements, other stuff that wouldn't be calculated on the MP Drain. Does the hit/miss/critical logic get run before or after the damage calculation?


Could you end up with MP Drain on skill use when it says the skill actually missed and no HP Drain happens?
@ksjp: Yeah, sorry. I realized I hadn't mentioned that and edited it in (after you saw the post, evidently).


And I'll have to think more deeply on those points, Shaz. I can't say it's an area I'm the most familiar with.


[Edit] Some quick tests indicate miss calculation is separate from damage calculation, so it works fine in that regard. As per variance, I suppose that's going to depend on what's needed for the skill. Something simple could be done in the formula box, but a new method could always be created if need be.
Just done a quick test, and the formula damages MP, but it doesn't absorb it.
With the type set to HP Drain? Works on my test of a new project. Any scripts that might be conflicting? And does the enemy actually have MP? I know I made that mistake on my first test.
I tried it out in a new project, everything default.  My actual formula is this (with HP Drain selected)

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

EDIT

It's difficult to say, because the figures fly past so quickly, but it looks like it's not absorbing HP either - at least the character seems to be perilously close to death at the moment, with being hit and not healed.
I took the formula you posted, fixed the error in the second half which was resulting in no hp damage (a.mat * - b.mdf) (multiplication and subtraction), pasted it in a brand new project, and it's working for me?
Oops.  Okay, I fixed the typo and carefully watched the figures.

Clearly damage was being done, because the enemies (3 wisps, who have 60MP each) were defeated, but the HP of the character did not increase, which it should have done if he'd been absorbing their HP, rather than just damaging them, and the MP figure went down each turn by the cost of the skill, it did not seem to absorb anything.
Screenshots of the skill in the database or idk? It's hard to troubleshoot the problem if I can't replicate it.
Here you are.  I have it as Certain Hit at the moment so that I don't have to contend with misses.

Skill%20shot_zps1nx5ttz3.png


EDIT

As you can't see the full damage formula, here it is copy/pasted

b.result.mp_damage = (10 +a.mat - b.mdf); 200 + a.mat - b.mdf

EDIT AGAIN

I am an idiot and a fool.  At some stage I must have clicked it back to HP damage from HP drain.

AND FINAL EDIT

It now works as intended.  Cringe, wince, sorry about wasting your time.  Crawls away into a corner in embarrassment.

Thank you for all your help.
It needs to be set to HP drain. You have it set to HP damage right now.
try changing the type to HP drain or mp drain

edit: what yato said
As you can see from my edits, I spotted that after posting, and I feel such a fool.

Once more, thank you Yato for your help.
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/absorb-hp-and-mp.36488/