Changing Luck's effect.

Normally, Luck determines the success rate of a State being applied on top of the skill's current chance. What if you didn't want that? I would like to make Luck help determine your pre-emptive encounter chance.
Then you'll need a plug-in to make that happen.

I've moved this thread to Plug-in Requests. Thank you.

If you have on map encounters, set one variable to the parties average luck. Then, when the party would engage in an encounter, roll a random variable between the variable and 100. If it's above a certain number, it turns on a switch. Then, in troop events on turn 0+0 if the switch is on, have it stun all enemies. This would function same as a preemtive

You may want to prevent luck from going over 100

Edit: Nevermind. Your going to have to roll a second variable between 1 and 100 and put the stat variable in a conditinal branch and check if the rolled variable is lower than the luck variable
This will only work if the enemies are not immune to Stun. A plug-in would be better as it can just give you a turn instead. I wrote one in ACE that forces a battle to be preemptive if you turn on a switch, and I'm sure someone can write the code similarly for MV.
They could make a custom stun the enemies arn't immune to, and set the removal to action end 1-1. And stunning all the enemies DOES give you a turn
There are still issues due to how LUK is hard coded into the game. For instance, LUK is still going to affect their rate of affecting status ailments in the entire game due to the code for how status ailments are applied, as the engine has a code which says:

Status aliment rate *= (modifier based on LUK).

For this reason it is very risky changing any default stats without a plug-in as the default internal code is still going to apply the stat by the default system as well. It *can* work, but it is not recommended.

Now if they don't care about that, then your method should work fine, and if so then they can report the post and ask for this to be closed. Though hey, maybe we'll still get a plug-in out of this too. More options is always good, right?
Yea, he would have to connect his skills to a common event and roll a variable a random number and have a "force action last target" Skill apply the state if the variable was above a certain number if he wanted to ignore luck completley using my solution
Actually you'd have to use certain hit too, with 100% chance, which would require two skills (one for the initial, one to add the state). The reason is even with force action, apply state uses the LUK stat modifier.

Though you might be able to get cute with add state in battle events too, as I think that ignores all modifiers unless you set them to resist that state completely.
Yanfly's Base Parameter Control plugin lets you null the standard LUK effect by setting it to zero in the plugin's parameters~

After a very quick search I couldn't find an existing plugin that makes preemptive rate be affected by LUK. These excerpts are what the default code uses to determine preemptive rate and LUK effect:
Spoiler: Base code excerpts (rpg_objects.js)
Code:
Game_Party.prototype.ratePreemptive = function(troopAgi) {
    var rate = this.agility() >= troopAgi ? 0.05 : 0.03;
    if (this.hasRaisePreemptive()) {
        rate *= 4;
    }
    return rate;
};
Code:
Game_Action.prototype.lukEffectRate = function(target) {
    return Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0);
};
If you just want to "move" the standard LUK effect from state application to preemptive rate (not doable directly since it typically compares battlers, not units), you could try something like this (attached):
Spoiler: Full code
Code:
(function(alias) {
'use strict';
  Game_Party.prototype.ratePreemptive = function(troopAgi) {
    // get original rate value
    var rate = alias.call(this, troopAgi);
    // get sum of all luk values for each unit
    var aLuk = $gameParty.aliveMembers().reduce(function(a, c) { return a + c.luk; }, 0);
    var eLuk = $gameTroop.aliveMembers().reduce(function(a, c) { return a + c.luk; }, 0);
    // divide by number of battlers (get mean value)
    aLuk /= $gameParty.aliveMembers().length;
    eLuk /= $gameTroop.aliveMembers().length;
    // multiply rate by "luk effect" and return new value
    rate *= Math.max(1.0 + (aLuk - eLuk) * 0.001, 0.0);
    return rate;
  };
})(Game_Party.prototype.ratePreemptive);
Yanfly's Base Parameter Control plugin lets you null the standard LUK effect by setting it to zero in the plugin's parameters~

After a very quick search I couldn't find an existing plugin that makes preemptive rate be affected by LUK. These excerpts are what the default code uses to determine preemptive rate and LUK effect:
Spoiler: Base code excerpts (rpg_objects.js)
Code:
Game_Party.prototype.ratePreemptive = function(troopAgi) {
    var rate = this.agility() >= troopAgi ? 0.05 : 0.03;
    if (this.hasRaisePreemptive()) {
        rate *= 4;
    }
    return rate;
};
Code:
Game_Action.prototype.lukEffectRate = function(target) {
    return Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0);
};
If you just want to "move" the standard LUK effect from state application to preemptive rate (not doable directly since it typically compares battlers, not units), you could try something like this (attached):
Spoiler: Full code
Code:
(function(alias) {
'use strict';
  Game_Party.prototype.ratePreemptive = function(troopAgi) {
    // get original rate value
    var rate = alias.call(this, troopAgi);
    // get sum of all luk values for each unit
    var aLuk = $gameParty.aliveMembers().reduce(function(a, c) { return a + c.luk; }, 0);
    var eLuk = $gameTroop.aliveMembers().reduce(function(a, c) { return a + c.luk; }, 0);
    // divide by number of battlers (get mean value)
    aLuk /= $gameParty.aliveMembers().length;
    eLuk /= $gameTroop.aliveMembers().length;
    // multiply rate by "luk effect" and return new value
    rate *= Math.max(1.0 + (aLuk - eLuk) * 0.001, 0.0);
    return rate;
  };
})(Game_Party.prototype.ratePreemptive);
Thanks man! I'll test it out today.
Great, hope it works for you!

Original thread: https://forums.rpgmakerweb.com/threads/changing-lucks-effect.114021/