Is this possible? A parameter increase when ally attacked.

Hi all!
I'm unfamiliar with the forums and not sure if this is the best place to ask this. Please feel free to redirect me if need be!

So essentially I always thought the idea that a "tank job" character using a provoke/taunt ability to force a boss to attack them is a little silly. Like why would a giant dragon care about the knight yelling obscenities at it when the dragon is smart enough to realize that the wizard is the one casting the painful spells?

Instead I thought it would be better if the reason why magical beasts target "tank job" characters is because those characters are the real threat. Essentially the tank job characters are monster slaying specialists with a deep understanding of monster biology. These specialists can take advantage of natural weak points to inflict devastating levels of pain if their opponent is distracted.

In order for this to reflect in actual gameplay I want to add a "Threat" state that increases the chance the character is targeted. But if the character under the "Threat" state is ignored for another target this increases the Attack stat and/or the character temporarily gains access to a skill they normally can't use.

I haven't the slightest clue how to accomplish such a mechanic. I'm super new to RPG Maker and am trying to make a small project that's mostly just fights. Is this type of mechanic possible in RPG Maker MZ? Any advice on videos to watch, articles to read, tutorials to follow would be appreciated.
theoretically anything and everything is possible - practically some effects require a lot more workk to achieve than others.
And this is one of them - the entire engine is build around single actions, and having one action affect something other than its official target is always more complex.

I can think of two different ways to accomplish what you want, but both cases require you to create variables to store past damage and past targets, and manually take them into account.
Either by very complex troop events checking for everything, or by plugins and javascript snippets entered into the regular code.

and neither of those is something that can be created by someone new with no experience in creating computer logic or programming javascript.

you might choose a third way by requesting someone else to program a specific plugin doing this however. But for that you'll need to design more details on the effects as you will not be doing the effect ypurself.
I can think of two different ways to accomplish what you want, but both cases require you to create variables to store past damage and past targets, and manually take them into account.
Either by very complex troop events checking for everything, or by plugins and javascript snippets entered into the regular code.

That sounds like something I'd be able to figure out. I've never used Javascript before but I've done coding in Actionscript 3.0, PHP, C++, and Game Maker's GML before. I'm no coding guru, but I can manage if I at least could be shown examples of how to do something remotely similar.

I've never used RPG Maker specifically before so everything is new to me and I'm not quite sure where to start.
OK, in that case I suggest an indirect approach with delaying that specific mechanic for a while.

work through the official tutorials first, and depending on what you prefer either go to some of the written and gaming tutorials I linked in my starting point tutorial in my signature (99% of that is still true for MZ despite being written for VXA), or some of the youtube tutorials.

It should take you a month or so to learn the basics of the maker and eventing.

Then you can decide whether to go the evented or the scripted route. Don't decide that until you know the basics and can identify what you're more comfortable with.

Evented: you'll need troop events in every troop (hint: search for base troop event plugin) that check the results before and after each turn, and give states resulting in the correct changes to your actors and enemies. Both states for target rate, for attack and invisible states that do nothing but mark targets for later checks.

Scripted: you'll need plugins that add action sequences to all skills - which for MZ means the Visustella set, and that in itself is a disadvantage as their code is hidden and you have to use what is available without being able to change everything.
Those plugins will give you notetags for additional places in the damage sequence like predamage calculations and so on, where you can use javascript to compare skill target with stored target and react.


The scripted version would be more direct with less code to handle, but also the one requiring more knowledge in javascript and internal engine functions. If you have that knowledge you will probably find that easier, but if you have problems with javascript and action sequences the other way is needed.
Thank you very much for all the advice, this is vastly appreciated!
In order for this to reflect in actual gameplay I want to add a "Threat" state that increases the chance the character is targeted. But if the character under the "Threat" state is ignored for another target this increases the Attack stat and/or the character temporarily gains access to a skill they normally can't use.
If you have familiarity with C++, you should be able to pick JavaScript right up. The syntax is basically identical, and you can Google any native functions you come across that you don't understand.

The thing I don't get about your mechanic, since you're trying to make it thematically-founded, is how this translates to threat. Are you intending to increase a stat/skill and also the target rate?

This plugin allows you to have formulae in your states that will produce a dynamic value for boosting parameters:

Then you'd use notetags from Yanfly's Buffs & States Core to do the reactions to hits.

So you'd make your Threat skill give that actor a Threat state. Then give everyone else a state - doesn't need an icon or any actual effects. But it would have:
Code:
<Custom React Effect>
if (this.isDamage() and value>0)
// Using Yanfly's origin variable to refer to your Threatening actor who gave us this state
    origin.addStateCounter(stateId, 1);
</Custom React Effect>

where stateId is the ID of your Threat state.

Then you can use Eli's plugin to calculate effects for the Threatening actor based on the number of state counters they have.
So you'd make your Threat skill give that actor a Threat state. Then give everyone else a state - doesn't need an icon or any actual effects. But it would have:
Code:
<Custom React Effect>
if (this.isDamage() and value>0)
// Using Yanfly's origin variable to refer to your Threatening actor who gave us this state
    origin.addStateCounter(stateId, 1);
</Custom React Effect>

where stateId is the ID of your Threat state.

Then you can use Eli's plugin to calculate effects for the Threatening actor based on the number of state counters they have.
Oh thank you for this! I was starting to figure something out, but this looks like it’d make the whole process much smoother.

Original thread: https://forums.rpgmakerweb.com/threads/is-this-possible-a-parameter-increase-when-ally-attacked.152669/