Yanfly Row formation/selection conditions question & shameless plea for assistance.


For convenience:
Link to Selection Control Plugin page: ( http://yanfly.moe/2016/04/22/yep-94-selection-control/ )
Link to Row Formation Plugin Page: ( http://yanfly.moe/2016/01/02/yep-54-row-formation/ )

First off, both plugins are working as intended!
…But I'm trying to do something with it that perhaps wasn't intended to do…

My current game project is using a row-based combat system. To boil it down:

Row 1: Tank (and aggressive melee) row. (Grants Agility bonus, but also increases Target Rate. )
Row 2: General melee row. (Small hit-rate penalty and no agility bonus, but increased resistance against magic damage, and less likely to take hits)
Row 3: Caster row. (Large agility malus, large hit-rate penalty but large resistance against magic damage)
Row 4: Recovery row. Sets large regens to both HP and MP, but lowers defenses to essentially nothing.

This is all in service of setting up a rock-paper-scissors relationship between melee attacks, ranged attacks, magic, and positioning, and make it desirable to occasionally change rows for strategic reasons, rather than just sit where you were put for the entire battle.

I have a good feeling about this system, but in order for it to work as intended, I need melee attackers from row 1 and row 2 to be able to attack each other interchangeably, but Row 3+ to be safe against marauding melee guys as long as the tank row is there to protect them.

Now, making a skill target only row 1 and row 2 is easy: <Select Conditions> Row 2 Max </Select Conditions>
And making a skill target only the Front row is is also easy: <Select Conditions> Front Row Only </Select Conditions>

But unfortunately neither of those two options do exactly what I need. For instance if the tank line on Row 1 is decimated, "Front Row only" will correctly evaluate to Row 2 , but there (as far as I am aware) is no way to then instruct the plugin that Row 3 should now also be targetable. And of course "Row 2 Max" will never allow anything past Row2 to be targeted.

What I essentially need is "Front Row +1" 😛

This seems like something that could be achieved using something along the lines of :

<Custom Select Condition>

if ( whateverRowTheTargetIsOn == whateverTheFrontRowIs || WhateverTheFrontRowIs++ ) // Forgive me, I REALLY don't know the proper nomenclature…
{
condition = true;
}
else
{
condition = false;
}

</Custom Select Condition>

…but I'm not familiar enough with JS or the variables RPGM uses to write that in away that will actually run. I do have programming experience (in GM:S), but unfortunately none of it has ever involved JS and so looking at it tends to make me go cross-eyed. Learning enough about JS and enough about how yan's plugin works to jury rig the conditional is a possibility, but it'd take a long time. I'm pretty excited about my first RPGM project, but it's really intended to be a fun side-project, so if I can keep my time investment down, that'd be ideal. 🙂

Anyway I am hoping some clever person can swoop in and give me some pointers on how to achieve the effect I want, either through the built-in Plugin commands (maybe I'm missing something?), fixing my awful attempt at a conditional, or via some other wizardry.

Thanks in advance for reading this far, and I hope you can help me out. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-row-formation-selection-conditions-question-shameless-plea-for-assistance.87972/