MV How can I make this skill work using Yanfly's Lunatic Mode?

Basically in a another game I'm working on, I'm trying to to make a skill call "Mend" that has 20% to fail, but I don't want to see the "There was no effect on %1!" message at all, so I've figured a good way to get around it is to code it in Lunatic Mode, but despite reading all the tips & tricks tutorials I'm still deeply confused by what "evals" I should use?

All I know is that it is gonna involve Yanfly's Battle Engine Core, Skill Core, and maybe Damage Core?

The skill goes a little something like this:
  • A message is sent to the battlelog saying: "(User) tries to mend its wounds..."
  • A selected animation plays.
  • A random number is generated between 1 and 0.
  • If the random number is below 0.8, then it "succeeds".
  • Then the user recovers 2.5 * MAT of HP with 10% variance.
  • And if possible, then a additional message is added saying: "...and recovers (HP Recovered) HP."
  • However if the random numbers passes 0.8, then it "fails", saying: "...but failed to."
So... is it possible to recreate? For the record it's my first time using Lunatic Mode, and once you guys showed me how to do it, I think I may able to comprehend it.
It should be possible. Been awhile since I've used SkillCore, so I'm rusty. It involves javascript coding though, if you didn't already know that.

I think the easiest method would be in the pre-damage eval, since that's where the split will happen for success/failure. There's a variable defined for that section for the resulting "damage"(healing if the skill is set up correctly). I BELIEVE it's "value". Anyway, set up the skill, with the formula you want. Then in the skill notes area, create a temporary variable in the correct notetag set, and set it to your random number. (Math.round()) Then check if the number is below 0.8. If it is not, set the value equal to zero.

For the battle log message... I don't know offhand how to set that. It's in the code somewhere but I've never bothered to look for it before. But if you figure that part out, set the message to your fail message if your number was above 0.8, and the success message if it was below.
Alright so... I think I managed to get working, while I'm not new to coding, I'm still quite new JavaScript and to Lunatic Mode as a entirely. I'm just leaving this here for future reference.

Code:
<setup action>
display action
</setup action>

<target action>
action animation
wait for animation
if (Math.random() < 0.80)
   action effect: target
else
   eval: BattleManager.addText("...but fails to.", 60)
end
</target action>

<finish action>
clear battle log
</finish action>

So if there is anyone else who is reading this... is there any sort way I could get the resulting number of HP Recovered for so I could use it for future battle text messages?
So if there is anyone else who is reading this... is there any sort way I could get the resulting number of HP Recovered for so I could use it for future battle text messages?
If you're using SkillCore, yes. Post-damage eval contains the resulting damage/healing. You could set a game variable to that value to reuse later.

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-make-this-skill-work-using-yanflys-lunatic-mode.139156/