Why wouldn't it work then? Unless you're suggesting they start the turn with 0 MP, do something to restore it with their first action, then exhaust it to 0 again with their second...which is technically possible, but seems a fringe scenario to me
THAT IS A FRINGE SCENARIO!

Your code shouldn't allow that. Remember, your code has a check at turn start. So if you start the turn with 0 MP then the hp reduction won't activate at all.
Although it is technically possible to circumvent the checks... you will need to go through a lot of hoops to do that.
I should have said it wouldn't work properly rather than it wouldn't work at all.

What I was actually envisioning was for the first action the actor uses a skill that would exhaust his remaining MP then for the second action he does something that doesn't cost MP e.g. default attack, guard, skills costing 0 MP, item use, etc. The HP reduction would occur twice in this case.
Although, come to think of it, if the first action reduced MP to 0 then they'd get smacked both times, as I have it written.
Actually, your code will work just fine in this case.
- Assumptions: One character party (or for that turn all companions either dead or disabled), actor can act twice per turn, actor has just enough MP to cast Skill X, actor uses Skill X on target TWICE.
- Action 1: Skill X activates; MP reduced to 0. HP reduced.
- Action 2: Actor just stands there looking stupid. No HP reduction.
But it's a lot of work to try to anticipate every scenario involved in a given thing.
In fairness to you, I get to cherrypick which threads I want to solve.

You on the other hand try to solve almost all support threads the moment they're posted while playing video games on the side.
On the other hand, figuring out the exclusions in this case sounds like a lot of work too.
I envision these scenarios because I don't want the OP to start a new thread complaining in the opening post "These guys' codes suck!"
Edit:
As an aside, to be fair to OPs, most of them aren't trolls.
I'm not sure if you remember
@ATT_Turan, that guy who used to make threads and lead posters on wild goosechases. You know, the guy who trolled Shaz in the latter's own profile page.