Help request: Controlling TPB battler order in more detail.

Not sure where exactly this belongs (Could it be done through eventing? Or is this script/plugin territory? If so, which?), so for now I guess I'm leaving it in the general forum?

So, long story short, for various reasons I want to be able to set the order people are going in myself in TPB rather than relying on the base system's (unconfigurable) process. One thing I am trying to set up is a D&D initiatve-style system where "initiative" is rolled (according to my own formula) at the start of a fight, and then for the rest of the fight the order that fighters go in is based on the result of that initial roll (with no overtaking).

From experimenting it seems like agility is what controls the speed of the bar's charging, and fighters with the same agility will charge it at the same speed. Because of this, I figured I could perhaps set up an event-based solution where every battler's agility would be temporarily set to x, x-1, x-2, etc. based on my roll, and leave it there until the first in "initiative" has their turn, at which point another event would set initiative to the same number for everyone. In effect, this would probably have achieved what I want it to.

In practice, however, this doesn't work: there seems to be some kind of variation built into the system. I'm not entirely sure whether it fills some bars up more than others for the first turn, or if the charging speed has some variation for the first turn only, but in practice this means that MZ already has its own "initiative roll" messing with whatever results I could have mine output.

So my question is: Is there a way to remove this variation and impose my own rules for the order in which TPB battler should go in? Can I just... overrule RPGM's TPB in this matter? Through eventing, scripting, or plugins?

Thank you in advance for your help!
base system's (unconfigurable) process.
Just because you do not know how it is configured does not mean that it is not configurable.

I admit that I haven't analysed the time system of MZ itself, but the turn-based systems have been using the following calculations in VXAce and in MV and they are probably the same if you set MZ to turnbased. And those values will likely have comparable effect on the time-based systems of MZ.

In turn-based, all actions are determined before execution.
then for every action, user.AGI and skill.SPEED are added together and given a random percentage bonus.
after that the actions are sorted from highes result to lowest and executed in that order.

Someone else would have to check the code to determine how MZ handles the combination of battler agility and skill speed for determining the order of the two variants of time-based counting, but they should similarly affect the ordering in some way.

And you can use that by manipulating battler agi (for example with states) to change the execution order. Or simply switch to turnbased in the system 1 tab of the database as that seemed to fit better to what you want.
Just because you do not know how it is configured does not mean that it is not configurable.

I admit that I haven't analysed the time system of MZ itself, but the turn-based systems have been using the following calculations in VXAce and in MV and they are probably the same if you set MZ to turnbased. And those values will likely have comparable effect on the time-based systems of MZ.

In turn-based, all actions are determined before execution.
then for every action, user.AGI and skill.SPEED are added together and given a random percentage bonus.
after that the actions are sorted from highes result to lowest and executed in that order.

Someone else would have to check the code to determine how MZ handles the combination of battler agility and skill speed for determining the order of the two variants of time-based counting, but they should similarly affect the ordering in some way.

And you can use that by manipulating battler agi (for example with states) to change the execution order. Or simply switch to turnbased in the system 1 tab of the database as that seemed to fit better to what you want.
I'm explaining the mechanics of it to him on Discord.

Original thread: https://forums.rpgmakerweb.com/threads/help-request-controlling-tpb-battler-order-in-more-detail.145223/