Pizza Mechanic Help

Food is going to be a core mechanic in my game. From searching for the ingredients to cook your own meals, to eating at local establishments, there will need to be a variety of food items to compensate for the breadth of available options. These items will all benefit players in a variety of ways, from buffs to boosts, and seeking them out will serve as an activity players engage in between major combat encounters.

I am currently designing a pizza item, featuring three different sizes (10", 12", 14" - all separate items). It is meant to heal the entire party on consumption, the size determining the amount healed. There's also a chance of it inflicting a negative status effect (heart burn). I want the chance of suffering from this effect to vary between sizes, and I would like the total number of party characters to influence the likelihood of as much (more people = more mouths to eat the greasy food, meaning less chances of heartburn). Is there any way for me to pull something like this off, or should I chuck this mechanic to the wayside?
The code is open, so anything can be done - it just requires more effort if the default engine doesn't support an idea.

for this idea, you basically have to have a damage/healing formula that includes the javascript code for the party size, and calculate with that.

So you'll have to use some minimum knowledge of javascript and how to use damage coding.
But if you have that knowledge (or are willing to learn it), then it can be done.

you also might want to use one of the plugins for code notetags in states to change the probabilities, as that would be easier that handling everything yourself.
If you're not already using any plugins that do this, you can use my Eval Tags, linked in my signature.

If you have VisuStella plugins in your project, you would use notetags from the Battle Core.

Using my Eval Tags, you'd give the pizza item something like:
Code:
<Action Post-Apply Eval>
if (!this.checkedStates)
{
    this.checkedStates = true;
// Each party member reduces chance by 20%
    let chance = 100 - $gameParty.members().length * 20;
    $gameParty.members().forEach(actor =>
    {
        if (Math.randomInt(100) < chance)
            actor.addState(42);
    });
}
</Action Post-Apply Eval>

Replace 42 with the ID of your heartburn state, adjust the formula as you like.

Original thread: https://forums.rpgmakerweb.com/threads/pizza-mechanic-help.172579/