Provoke skill/state and target rate explanation requested

Hey all,
I'm having a hard time understanding something. So I have 2 characters in battle. One with a class that has a trait of Target Rate * 25%, the other with Target Rate * 200%. If I'm not mistaken, the one with the 200% should be the enemy's target most of the time? Anyway, using Yanfly's auto passive skills, I've applied the Provoke state to the character with * 200%, Provoke itself having a target rate of 1000%. Just looking at the numbers, it would seem like the character with 200%+1000% should be the ONLY target the enemies look at, but they're going after the character with only 25% target rate on a very regular basis. What am I getting wrong here?
So the way a unit (party or troop) decides on a random target is this:

JavaScript:
Game_Unit.prototype.randomTarget = function() {
    var tgrRand = Math.random() * this.tgrSum();
    var target = null;
    this.aliveMembers().forEach(function(member) {
        tgrRand -= member.tgr;
        if (tgrRand <= 0 && !target) {
            target = member;
        }
    });
    return target;
};

And tgrSum itself looks like this:

JavaScript:
Game_Unit.prototype.tgrSum = function() {
    return this.aliveMembers().reduce(function(r, member) {
        return r + member.tgr;
    }, 0);
};

Let's work through that line by line for your party:

1.tgrRand is set to a random value between 0 and 1 multiplied by the sum of your party's TGR stats.
- Your character with 25% will add 0.25 to the sum
- Your character with 200% and Provoke will add...hm.

The thing to remember is that TGR traits are multiplicative, not additive, first of all.

So the way it works out the final TGR for this actor is that it starts with a value of 1. Then it'll multiply that by 2 for the 200%, for a value of 2. Then it'll multiply that by 10 for a value of 20.

So tgrRand will end up being (0-1) * 20.25. Let's say the value is 0.5096102024035019. tgrRand will be 10.319606598670913475.

2. target is set to null. Straightforward.
3. Our forEach loop hits the first party member. We subtract that member's TGR from tgrRand. That leaves 10.069606598670913475.
4. tgrRand is not less than or equal to 0, so we move on.
5. Our forEach loop hits the second party member. We subtract that member's TGR from tgrRand. That leaves -9.930393401329086525.
6. tgrRand is less than or equal to 0, target is set to party member #2.

So ostensibly it will be your 200% + Provoke character, more often than not. But this is dependent on the RNG.

In order for your first party member to be chosen as the target, the random number generated only needs to be roughly 0.01234 or less. Which doesn't seem like a huge range but if you get unlucky with your seeds you can hit that multiple times in a row pretty easily. And if you're unlucky enough to have the random number be in the range where the 25% TGR actor will be chosen, it doesn't actually matter what anyone else's TGR is.

This means it's actually better to have higher TGR characters in higher party slots, since it works through them in order and those actors are significantly more likely to remove enough value from tgrSum to get it less than or equal to 0.
That was in-depth - not sure I fully understand, but I get it well enough. Unfortunately changing formation isn't an option for this project, and I've looked for ways to maybe just change the formation in battle only but no luck. I'll accept that I'm getting a bad roll of the dice and keep plugging away at it, see what additional testing yields. Thank you for your reply.

Original thread: https://forums.rpgmakerweb.com/threads/provoke-skill-state-and-target-rate-explanation-requested.143183/