How to make a skill that leaves user at 1 hp and skills that infict damage leaving party with 1 hp?

Sorry for the long thread title.
I'm trying to make a limit break that infilicts tremendous damage but uses up all user hp leaving him to 1hp and a an enemy skill that inflict damage to an actor or whole party, leaving them with 1 hp, and that slows down the user (enemy in this case) so that he cant attack soon to kill party in a single turn (Using yanfly atb for now but planning to switch to MOG atb due different modes of atb)
Thanks for the help!
simple - use a damage formula like (b.hp - 1)
this means that it will inflict the targets current HP minus 1 as damage, leaving with a rest of 1 HP.

Attention: there are some effects that change damage outside the damage formula, like elemental rates and general damage rates. If those are used in your game, then you'll need to counter their effects by including them into the damage formula.
simple - use a damage formula like (b.hp - 1)
this means that it will inflict the targets current HP minus 1 as damage, leaving with a rest of 1 HP.

Attention: there are some effects that change damage outside the damage formula, like elemental rates and general damage rates. If those are used in your game, then you'll need to counter their effects by including them into the damage formula.

This for the enemy skill right? What about the skill that costs user hp? a.hp - 1 with yanfly skill cost?
Attention: there are some effects that change damage outside the damage formula, like elemental rates and general damage rates. If those are used in your game, then you'll need to counter their effects by including them into the damage formula.
In theory (I don't have MV open to test right now) you could get around mitigation and resistances by putting something like this in the damage formula box:

b.gainHp(-(b.hp - 1)); 0

That applies the value directly to the target with no way for it to be reduced.

This for the enemy skill right? What about the skill that costs user hp? a.hp - 1 with yanfly skill cost?
Yanfly's Skill Core plugin lets you do this with note tags.

Edit: Reading comprehension fail on my part. You should be able to use something like this in Skill Core's note tags:

<Custom HP Cost>
user.hp - 1;
<Custom HP Cost>

Again, I don't have MV open so I can't test, so hopefully it's just looking for a value and not expecting anything too fancy.
Thanks for your help! I will try those and see how they work when i get home!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-skill-that-leaves-user-at-1-hp-and-skills-that-infict-damage-leaving-party-with-1-hp.97028/