[Solved]How to make a decreased exp gaining system?

More and more enemies are defeadted by the player, and player becomes stronger.

If a Lv30 player goes back to the beginning dungeon, then the player still can get EXP from beginning enemies.

How to make a decreased exp gaining system like this?
For instance:
A goblin as enemy that you can get from him is 100EXP.
If average level of player's party is 10, you can get 60EXP from him.
If average level of player's party is 20, you can get 30EXP from him.
If average level of player's party is 30, you can get 0 EXP from him.
Yanfly's Enemy Base Params plugin and in notetag of enemy in database place this:
<Custom Enemy Parameters>
hp=xxxx
mp=xxxx
atk=xxx
def=xxx
mat=xxx
mdf=xxx
agi=xxx
luk=xxx
exp=Math.floor(xxx * ($gameParty.averageLevelAllMembers() / 100))
gold=xxx
</Custom Enemy Parameters>

In place of xxxx's type your params
now explaining exp parameter from notetag is very simple... Higher average level of party, the lower value of exp you gain from specific enemy.
Yanfly's Enemy Base Params plugin and in notetag of enemy in database place this:
<Custom Enemy Parameters>
hp=xxxx
mp=xxxx
atk=xxx
def=xxx
mat=xxx
mdf=xxx
agi=xxx
luk=xxx
exp=Math.floor(xxx * ($gameParty.averageLevelAllMembers() / 100))
gold=xxx
</Custom Enemy Parameters>

In place of xxxx's type your params
now explaining exp parameter from notetag is very simple... Higher average level of party, the lower value of exp you gain from specific enemy.
Thanks! but I have to put another plugin above Enemy base pararms plugin, which is Enemy Levels plugin.. Ehhh....I dont want enemies to have levels..... So...

Is there any simple script that can change the exp rate?
For intance:
Battler.prototype.EXP Rate = (value 50%)
I don't know how to write the syntax correctly, I appreciate anyone who could help me with this.
In Enemy levels plugin you can hide levels - https://prnt.sc/uf5r4u
But if you still don't want them, then this code (save as plugin) should do the trick:
Code:
Game_Actor.prototype.gainExp = function(exp) {
    var newExp = this.currentExp() + Math.round(exp * this.finalExpRate());
    this.changeExp(newExp * Math.floor(exp * ($gameParty.averageLevelAllMembers() / 10)), this.shouldDisplayLevelUp());
};
In Enemy levels plugin you can hide levels - https://prnt.sc/uf5r4u
But if you still don't want them, then this code (save as plugin) should do the trick:
Code:
Game_Actor.prototype.gainExp = function(exp) {
    var newExp = this.currentExp() + Math.round(exp * this.finalExpRate());
    this.changeExp(newExp * Math.floor(exp * ($gameParty.averageLevelAllMembers() / 10)), this.shouldDisplayLevelUp());
};
I tired, it just hide level value. The enemy's MaxHp MaxMP ATK DEF are still growthing under Yep_Enemylevels that is unnecessary. I only need to change EXP rate, not enemy growth system.
I am gona try your code. Anyway, thanks.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-how-to-make-a-decreased-exp-gaining-system.127122/