Range using ATB or CTB order

I am at a point where I need to decide whether to use ATB, CTB, or scrap VisuStella and go with Yanfly so I can make or commission a custom plugin. I want my battle system to incorporate 4 target types: Single target, Adjacent targets, Area targets, or All Targets. The battlefield itself is a poor way to do this since the characters are always close together, so I want to use turn order as a basis of distance.

In CTB, the friend or foe Plus or Minus one slot would be adjacent. Plus or Minus two slots would be Area. Is there a way to query the slot number of your currently selected target or character?

In ATB, I assume that %fill of the ATB gage could be used, so that all possible targets within 10% of the fill range of primary target would be adjacent. All possible targets within 20% of the targets ATB fill% would be included in area effects. Is there a way to query the % fill of ATB gage of a selected target or character in order to create conditionals based on it?

The other question I have is whether it is possible to add vulnerabilities or immunities to targets that are casting.
Is there a way to query whether a selected target or character is currently casting?
My questions are:

  1. Is there a way to query the slot number of your currently selected target or character?
  2. Is there a way to query the % fill of ATB gage of a selected target or character?
  3. Is there a way to query whether a selected target or character is currently casting?
*Note that these are not supported by the VisuStella plugins but should be possible somehow.

Original thread: https://forums.rpgmakerweb.com/threads/range-using-atb-or-ctb-order.173692/