Need a plugin that allows for changing Max Level in-game

What I need is a plugin that allows for changing a character's Max Level within the game. Like for example, a character's default max level is set to 30, but can either complete a quest or use an item on that character (both could utilize a Plugin/Script Call) that would increase their max level by a specified amount. In some games this is referred to as 'Ascension'.

However, I am using Yanfly's Core Engine (http://yanfly.moe/2015/10/09/yep-1-core-engine/) & it already has a parameter to control the max level so I would need this plugin to override the Core Engine's control of that function, if possible.
Easy workaround:

Create a duplicate class for the character
On notes (for the class) change the max level
* <Max Level: x>
* Changes the actor's max level to x. This allows you to bypass the editor's
* level 99 limit.

Just change Class for the hero (since it is a duplicate with just different "notes" it will be user unnoticable.


Edit:
@Animebryan does that solve your case or do you still need something more complex?
If so please provide us more information describing what your needs are. 🙂
@Dreadshadow unfortunately I think that notetag is only for Actors. 😅

Should be fairly easy to work around, but I'm going to get some lunch right now, be back in a bit~
Ok then, we create a duplicate actor, but if you can make an override please do! 😀
[Edit: actually I re-read your request and now realise you want something more in-depth... 😩 Lookin' into it! See follow-up post below!]

Try saving this as a .js file and importing it as a plugin~
Spoiler
Code:
(function() {

'use strict';

  // Check for <Max Level: x> notetag on current class (case-sensitive!)
  let _Game_Actor_maxLevel = Game_Actor.prototype.maxLevel;
  Game_Actor.prototype.maxLevel = function() {
    return parseInt(this.currentClass().meta['Max Level']) || _Game_Actor_maxLevel.call(this);
  };

  // Clamp level to max after changing class
  let _Game_Actor_changeClass = Game_Actor.prototype.changeClass;
  Game_Actor.prototype.changeClass = function(classId, keepExp) {
    _Game_Actor_changeClass.call(this, classId, keepExp);
    this._level = this.level.clamp(0, this.maxLevel());
    this.refresh();
  };

})();
Basically, this will just let the game recognise <Max Level: x> notetags on classes. Then you can use the class change approach @Dreadshadow suggested. 🙏

(Note that the way I've implemented it means the class notetags are case-sensitive, i.e. it has to be <Max Level: 30>, not <Max level: 30> or something. 😅)
So would this be an add-on to Yanfly's Core Engine? Do I just place it underneath that plugin?
So would this be an add-on to Yanfly's Core Engine? Do I just place it underneath that plugin?
Yes, load it after Yanfly's Core Engine. 🙂

Edit: currently trying to find a nice way to implement +/- max level stuff... It looks like it may be better to use several classes at fixed intervals. ._.

Edit2 @Animebryan: OK I think I have something, try the attached plugin (full code in spoiler below). It lets you put <Max Level Add: x> tags on states; the notetag values are included in the maxLevel calculation. It also includes the class notetag thing in case you wanted that in there too. As before, just load it after Core Engine and it should be OK~ 😮‍💨
Spoiler: Full code
Code:
// ==================================================
// Cae_MaxLevelAdjust.js
// ==================================================

/*:
 * @plugindesc v1.0 - Adjust max actor level via notetags.
 * @author Caethyril
 *
 * @help Plugin Commands:
 *    None.
 *
 * Class notetag:
 *   <Max Level: x>
 *     - sets max level to x
 *     - overrides actor's original max level
 *
 * State notetag:
 *   <Max Level Add: x>
 *     - adds x to base max level (x can be negative)
 *     - multiple notetags add their values
 */

var Imported = Imported || {};			// Import namespace
Imported.Cae_MaxLevelAdjust = 1.0;		// Import declaration

var CAE = CAE || {};				// Author namespace
CAE.MaxLevelAdjust = CAE.MaxLevelAdjust || {};	// Plugin namespace

(function(_) {

'use strict';

	const TAG_ML    = 'Max Level';
	const TAG_MLADD = 'Max Level Add';

	// Notetag value getters
	_.getTag   = function(o, p) { let r = o.meta[p]; return isNaN(r) ? 0 : parseInt(r); };
	_.getTagML    = function(o) { return _.getTag(o, TAG_ML);    };
	_.getTagMLAdd = function(o) { return _.getTag(o, TAG_MLADD); };

	// For base max level (class tag or default)
	_.getMaxLevel = function(actor) {
		return _.getTagML(actor.currentClass()) || _.Game_Actor_maxLevel.call(actor);
	};

	// Returns sum of contributions from relevant state notetags
	_.getMaxLevelAdd = function(actor) {
		let s = actor.states();
		let v = 0;
		s.forEach(function(o) { v += _.getTagMLAdd(o) });
		return v;
	};

	// Refreshes input actor's level if appropriate
	_.refresh = function(actor) {
		let newML = actor.level.clamp(0, actor.maxLevel());
		if (actor._level !== newML) {
			actor._level = newML;
			actor.refresh();
		}
	};

	// Change of calculations! (The alias is called via getMaxLevel.)
	_.Game_Actor_maxLevel = Game_Actor.prototype.maxLevel;
	Game_Actor.prototype.maxLevel = function() {
		return _.getMaxLevel(this) + _.getMaxLevelAdd(this);
	};

	// Check/impose max level when changing class
	_.Game_Actor_changeClass = Game_Actor.prototype.changeClass;
	Game_Actor.prototype.changeClass = function(classId, keepExp) {
		_.Game_Actor_changeClass.call(this, classId, keepExp);
		_.refresh(this);
	};

	// Check/impose max level when adding states
	_.Game_Actor_addNewState = Game_Actor.prototype.addNewState;
	Game_Actor.prototype.addNewState = function(stateId) {
		_.Game_Actor_addNewState.call(this, stateId);
		_.refresh(this);
	};

})(CAE.MaxLevelAdjust);
Edit3: Never mind, BlackGoldSaw posted a much better alternative below (I really should have looked harder for existing plugins...).
If you still need it, Mr.Trivel has a plugin that does exactly what you need. (I use it myself.)

Max Level Restrictions

Link

Original thread: https://forums.rpgmakerweb.com/threads/need-a-plugin-that-allows-for-changing-max-level-in-game.108432/