Using HP to use skills once MP runs out.

I need a way for skills and attacks to use up HP after the player runs short on MP
So I wanna know if there is a plugin that would help me do this or not,
non plugin ways are cool too.
I think that a modification of the skill via Yanfly's Skill Core would be able to achieve this. Perhaps someone who knows JS would be able to assist you in constructing the proper code check to make that happen?

Original thread: https://forums.rpgmakerweb.com/threads/using-hp-to-use-skills-once-mp-runs-out.77606/