Shield Durability

So I want to create this magic spell to summon a shield. The shield affects one chosen member of the party, and it has a set durability. As long as the shield is up, that actor will not take damage. How can I do this?
By durability I assume you mean it lasts for a certain amount of hits. If that's the case you could check out this plugin:

http://www.yanfly.moe/wiki/Absorption_Barrier_(YEP)

Original Link
http://yanfly.moe/2016/02/13/yep-70-absorption-barrier-rpg-maker-mv/
By durability I assume you mean it lasts for a certain amount of hits. If that's the case you could check out this plugin:
http://www.yanfly.moe/wiki/Absorption_Barrier_(YEP)

Original Link
http://yanfly.moe/2016/02/13/yep-70-absorption-barrier-rpg-maker-mv/

I checked it out, it seems to work for me. Although, is there a way I can set a maximum to the barrier points based on a chosen stat?
is there a way I can set a maximum to the barrier points based on a chosen stat?

I think you would need to edit the way that the plugin applies barrier points if you wanted a hard cap on them. Something like this should work:

Code:
Game_Battler.prototype.gainBarrier = function(value, turn) {
    this.initAbsorptionBarrier();
    value = Math.floor(value);
    if (turn > 0) {
      turn -= 1;
      this._turnBarrier[turn] = this._turnBarrier[turn] || 0;
      this._turnBarrier[turn] += value;
      this._turnBarrier[turn] = Math.max(0, this._turnBarrier[turn]);
    } else {
      this._permBarrier = this._permBarrier || 0;
      this._permBarrier += value;
      this._permBarrier = Math.max(0, this._permBarrier);
      // Edit: give barriers a cap
      var maxBarrier = 100;
      if (this._permBarrier > maxBarrier) {
         this._permBarrier = maxBarrier;
      }
      // End edit
    }
    this._barrierAltered = true;
    this.refresh();
};

You'll need to change maxBarrier to whatever formula you'd like to use for the cap.
You'll need to change maxBarrier to whatever formula you'd like to use for the cap.

And how can I do that for the actor's maximum MP?

Edit: I just don't know what to put there.
Try:

Code:
var maxBarrier = this.mmp;
This works! Thanks!
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/shield-durability.111333/