Need help adjusting Yanfly's 'Second Chance' state effect

I'm planning on including a Guts state featured in Yanfly's 'Second Chance' Tips & Tricks video but the original way he sets it up only revives you at 1 HP. I plan on making 10 variations with a increasing percentage of HP restored instead, but I don't know how to make the change in the notetag:

Code:
<Custom Respond Effect>
// Check to see if the party is in battle, has the Second Chance flag, and if the target is dead with 0 HP.
if ($gameParty.inBattle() && target._secondChance && target.hp <= 0) {
  // Play the revival animation.
  target.startAnimation(49);
  // Set the target's HP to 1.
  target.setHp(1);
}
</Custom Respond Effect>

The target.setHp(1) part is where the HP restore effect is set. How do I set it to a percentage of Max HP instead?
Try something like this:
Code:
target.setHp(target.mhp * 0.2);
I.e. "set the target's HP to 0.2 times (i.e. 20% of) the target's max HP". Then just change the number as needed for different percentages. 🙂
Better place a Math.floor, or Math.round, or Math.ceil before "target.mhp * 0.2", like "target.setHp(Math.floor(target.mhp * 0.2))". If you don't do that, your HP displayed might be a float, not integer and it looks ugly.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-adjusting-yanflys-second-chance-state-effect.109061/