MZ Seeking plugins to mimic BoF2/3's Guts ability

Greetings, all! This is more of a "does anyone know where we can find..." request than asking someone to make it for us because something like it probably exists somewhere out there already, but I wasn't sure where else to put it. Apologies if this is the wrong forum. 😅

Resource Type: Plugins, or database/engine stuff if the settings exist somewhere already
Maker Format: MZ
Makers We Own: VX Ace, MV, MZ
Art Style: N/A
Description: In the RPGs Breath of Fire II and Breath of Fire III, there's a mechanics called "Guts" that gives characters a chance to auto-revive themselves when knocked out. We're looking for something similar. It would work as follows:
  • Actors need to have a new custom parameter--I believe BoF3 calls it "Willpower," but any name works, really. (If we're not misreading, then something like Hakuen Studio's Custom Parameter plugin should be able to do this already.)
  • When an actor takes fatal damage in battle, there should be a percent chance of activating their Guts ability directly tied to their Willpower parameter. (Example: Someone with a Willpower stat of 10 has a 10% chance of Guts activating when they take fatal damage.)
  • When Guts activates, they survive the attack with 1 HP. Or, rather, they fall as if defeated, but then get back up again as if brought back by an auto-life/reraise effect, which leaves them at 1 HP. In BoF3, negative statuses that would disappear on death (Poison, Confuse, etc.) are dispelled, but it keeps the positive ones (Buffs, Regens, etc.) as if the party member in question never dropped.
  • This is not a buff or a state that would be applied manually, like from a spell or item or something, the way a classic auto-life/reraise spell; this is a persistent, permanent effect innately tied to the actor such that all party members will always roll against their Willpower stat to check for a Guts event upon defeat.
  • (If we're not misreading, then something like VisuStella's Life State Effects plugin looked like a promising lead, in that it allows for auto-life/reraise effects at all when that doesn't appear to be something RMMZ natively does. However, theirs is the classic spell type, which must be applied and then will go off without fail. There does not seem to be a way to make it an innate persistent always-on effect instead, nor does there appear to be a way to change the odds of it happening.)
  • Optional, but cool thematic dramatic points: in Breath of Fire II, a character who was wiped out and then gets back up with 1 HP due to a Guts effect will have a short line they say upon standing back up, something like "Not... yet...!" or "Is that all you've got??" or the like. Just a cool one-liner to sell the idea of them getting back up due to Guts as this anime-esque show of pure willpower that they're still standing. (If we're not misreading, then something like VisuStella's Gab Window plugin appears to be able to do this, assuming it recognizes the Guts effect as a state to react to, which... actually, it may or may not? Its documentation is here, but I'm not quite clever enough to recognize the list of... like... in-battle states/events it recognizes as something to react to, in all of this. 😅)
Reference Images: N/A

Again, we are fully aware how much work it takes to make a whole entire engine plugin from scratch, which is why this was more of a "does something like this already exist somewhere?" request than anything else. Still, any help is much appreciated either way! Thank you so much!!
this was a simple line of code in tomoakys SRPG in VX. when HP < 0 , HP = 1. something like that.

I've moved this thread to JS Plugin Requests. Thank you.

Resource Requests is meant for graphics or music requests, plugins have their own dedicated section.
Oops, apologies for guessing wrong, and thank you for putting it in the correct place. ^^;

So, as an update to this, we found another plugin that looks very promising: VisuStella MZ's Auto Skill Triggers. With this, it's possible set up a skill in the Skills section of the database that does most of what we want a triggered Guts event to do--heal 1 HP and remove the Death status, cleanse negative statuses, possibly display that one-liner? Other plugins out there can customize and expand on what you can do with Skills in the Skills database, I'm sure. Anyway, once the "Guts" skill exists, we could use the Auto Skill Triggers plugin to set up a skill trigger that goes off when an actor dies and point it to the Guts skill. It does have the ability to set a trigger with a percent chance of activating, rather than a guaranteed one.

Our questions at this point, for anyone who owns this plugin and/or is connected to the VisuStella staff and might know, pertains to the exact wording of when you do it like that. Quoth their documentation:

<Auto Trigger x%: condition> - Used for: Skill Notetags - Turns this skill into an Auto Trigger Skill, where it will automatically be used if the 'condition' has been met. - If using the x% variant, the Auto Trigger has a x% chance to occur. - Replace 'x' with a number value representing the chance to succeed.

So, for those who would know:
  • Rather than having to be a simple integer, can you replace 'x' with a call or reference to some other parameter or variable? That's literally what I was suggesting in the original post, after all--to give actors a new stat/parameter called "Willpower" whose function is just a straight 1:1 odds setting where they have a [Willpower]% chance of having a Guts event instead of dying when defeated.
  • If it can't support that natively, I think there are other plugins out there whose function is specifically to allow just that--to take a piece of code where you used to have to enter a number (and only a number,) and allow you to put a call/reference to a skill/parameter or some other variable there instead. (I think, off the top of my head, @Eliaquim might have made something like that in his catalog somewhere? But memory is very fuzzy, alas....) Assuming such a plugin exists, would it be compatible with this? (That is, would "[Willpower]% chance to trigger Guts skill" work even if you have to use another plugin to do it?)
  • Can the skills called by this plugin upon death interrupt said death? I guess all of this would be for nothing if the trigger remembers that the actor was about to die and just lets them get their one last hurrah off, and you set said hurrah to remove the death status and heal them and whatever else you want to do there, and then it just kills them again after all that resolves anyway. :yswt2:
Hi there!

I don't know for sure if my plugins can cover that. I would have to try, but I believe it needs a lot of workarounds. I guess this code should help you with that, using my custom parameter plugin to add the willpower parameter.

So first, put that into a .txt file, save it, then change the extension to .js.
Now put it on your plugin manager.

JavaScript:
{
const Game_Actor_addNewState = Game_Actor.prototype.addNewState
Game_Actor.prototype.addNewState = function(stateId) {
    const gutsChance = Math.randomInt(100) <= this.cparam(ID)
    if(stateId === this.deathStateId() && gutsChance){
        this.revive()
    }else{
        Game_Actor_addNewState.call(this, stateId)
    }
}
}

replace the ID with the ID of the custom parameter you set as willpower.
When the game tries to add the Death state to an actor, it will check if the guts chance is successful.
If it is, then it will not apply it and rather set the actor HP to 1.

[EDIT] I didn't test it. Don't know if it will work haha ^^''
Hi there!

I don't know for sure if my plugins can cover that. I would have to try, but I believe it needs a lot of workarounds. I guess this code should help you with that, using my custom parameter plugin to add the willpower parameter.

So first, put that into a .txt file, save it, then change the extension to .js.
Now put it on your plugin manager.

JavaScript:
{
const Game_Actor_addNewState = Game_Actor.prototype.addNewState
Game_Actor.prototype.addNewState = function(stateId) {
    const gutsChance = Math.randomInt(100) <= this.cparam(ID)
    if(stateId === this.deathStateId() && gutsChance){
        this.revive()
    }else{
        Game_Actor_addNewState.call(this, stateId)
    }
}
}

replace the ID with the ID of the custom parameter you set as willpower.
When the game tries to add the Death state to an actor, it will check if the guts chance is successful.
If it is, then it will not apply it and rather set the actor HP to 1.

[EDIT] I didn't test it. Don't know if it will work haha ^^''
Oh my gosh, you absolutely continue to amaze us with your responsiveness and the lengths you go to help us out with each one of your plugins we use. You wrote a JavaScript script for us just based on this question? Really?? We were just asking if anyone who had this plugin knew if it would work, not asking for someone to make something for us. :kaomad3: You really are the most generous developer we've ever interacted with and an absolute blessing to the entire RPG Maker community.

We currently have a few things to work out elsewhere in the project (a lot of this post was like... planning ahead, if I'm being honest 😅,) but we'll play around with this and see how it goes when we're able. Thank you so much, truly!!
Just to put it out there, as you were looking at VisuStella plugins, this is also easily done with just the Battle Core.

You can put a JS Post-Apply as Target notetag either directly onto an actor or in a state or passive state (from Skills & States Core). Inside that notetag you could put very similar code to what Eliaquim provided - no need for any fancier plugins.

You could also put it in a JS Add or whatever it's called from the Skills & States, on the death state itself.

Original thread: https://forums.rpgmakerweb.com/threads/seeking-plugins-to-mimic-bof2-3s-guts-ability.159371/