code:
//=============================================================================
// メニュー画面
//=============================================================================

    Window_MenuCommand.prototype.maxCols = function() {
        return 4;
    };

    Window_MenuCommand.prototype.numVisibleRows = function() {
        return 2;
    };

     Scene_Menu.prototype.commandPersonal = function() {
        this._statusWindow.setFormationMode(false);
        switch (this._commandWindow.currentSymbol()) {
        case 'skill':
            SceneManager.push(Scene_Skill);
            break;
        case 'equip':
            SceneManager.push(Scene_Equip);
            break;
        case 'status':
            SceneManager.push(Scene_Status);
            break;
          }
    };

//メニューウィンドウ

Yanfly.MMM.Scene_Menu_createLifeWindow =
    Scene_Menu.prototype.createLifeWindow;
    Scene_Menu.prototype.createLifeWindow = function() {

    this._lifeWindow = new Window_Base(920,520,300,270);
    this.addWindow(this._lifeWindow);

    var Actor1 = $gameActors.actor(1);
    var lifeWin = this._lifeWindow;
    var value1 = this._lifeWindow.textWidth('000');
    var value2 = Actor1.nextRequiredExp();

    lifeWin.drawText("LV: "+Actor1._level, 0,10);
    lifeWin.drawText("HP:", 20,45);
    lifeWin.drawText(Actor1.hp, 67,45, value1, 'right');
    lifeWin.drawText("/", 103,45);
    lifeWin.drawText(Actor1.mhp, 118,45, value1, 'right');
    lifeWin.drawText("MP:", 20,75);
    lifeWin.drawText(Actor1.mp, 67,75, value1, 'right');
    lifeWin.drawText("/", 103,75);
    lifeWin.drawText(Actor1.mmp, 118,75, value1, 'right');

	//Japanese
	/*
    lifeWin.drawText("攻撃力: "+Actor1.param(2), 20,125);
    lifeWin.drawText("防御力: "+Actor1.param(3), 20,160);

	if(Actor1._level < 69 )
	{
		lifeWin.drawText("次のLVまで: "+value2, 20,195);
	}
    else {
		lifeWin.drawText("次のLVまで: MAX", 20,195);
	}

*/
	//English

	lifeWin.drawText("Attack : "+Actor1.param(2), 20,125);
    lifeWin.drawText("Defense: "+Actor1.param(3), 20,160);

	if(Actor1._level < 80 )
	{
		lifeWin.drawText("Next LV: "+value2+" XP", 20,195);
	}
    else {
		lifeWin.drawText("Next LV: MAX", 20,195);
	}

	if($gameSwitches.value(197)) {
		if($gameSwitches.value(244)) {
			var tiara = ImageManager.loadPicture('tiara2');
			var tiaraSprite = new Sprite();
			tiaraSprite.x = -12;
			//Japanese y
			//tiaraSprite.y = -60;
			//English y
			tiaraSprite.y = -67;

			tiaraSprite.bitmap = ImageManager.loadPicture('tiara2');
			lifeWin.addChild(tiaraSprite);
		}
		else {
			var tiara = ImageManager.loadPicture('tiara');
			var tiaraSprite = new Sprite();
			tiaraSprite.x = -12;
			//Japanese y
			//tiaraSprite.y = -60;
			//English y
			tiaraSprite.y = -67;
			tiaraSprite.bitmap = ImageManager.loadPicture('tiara');

		}

		lifeWin.addChild(tiaraSprite);

	}
};

//エロ体験

Yanfly.MMM.Scene_Menu_createHentaiWindow =
    Scene_Menu.prototype.createHentaiWindow;
    Scene_Menu.prototype.createHentaiWindow = function() {

    this._hentaiWindow = new Window_Base(0,107,850,622);
    this.addWindow(this._hentaiWindow);

    var hWindow = this._hentaiWindow;
    var valueWidth = hWindow.textWidth('0000');
    var hasOrb = $gameParty.hasItem($dataItems[115]);

    //hTextHeight is y position of each menu item
    var hTextHeight = [ 95, 120, 145, 170, 195, 221, 247, 272, 297, 323, 348, 374, 399, 424, 450, 475, 500, 526 ];
    //hTextWidth is the x position of
    //hTextWidth[0]= Current H value
    //hTextWidth[1]= Position of the '/'
    //hTextWidth[2]= Next H requirement
    //hTextWidth[3]= bitch level
    var hTextWidth = [ 235, 250, 290, 235 ];

    //hValues is the string that will hold the current value of each H
    var hValues = [];
    hValues.length = 18;

    //hValueID is what each menu item starting top to bottom correlates to the ingame variable key
	//Japanese order
    //var hValueID = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 ];
	//English order
	var hValueID = [ 1, 2, 3, 10, 8, 9, 16, 5, 7, 6, 12, 4, 13, 15, 14, 11, 17, 18 ];

    /*
    	In order of the ingame variable key
    	1 絶頂 2 6 12 20 35 50 69 85 99 120 145 170 200
    	2 フェラ 1 3 8 14 20 30 42 54 69 99
    	3 パイズリ 1 2 4 7 12 25 38 50 69 99
    	4 露出 1 3 5 10 17 25 32 40 50
    	5 アナル 1 2 6 11 18 30 42 55 69 99
    	6 オナニー 1 3 6 10 17 24 32 42 55 69
    	7 おしっこ 1 3 5 10 17 25 32 40 50
    	8 精飲 1 3 6 12 20 30 42 55 69 85 99 125
    	9 ぶっかけ 3 5 9 14 20 28 40 52 69 99
    	10 ケツ舐め 1 2 5 10 16 24 34 48 60 75
    	11 売春 1 2 4 8 14 20 30 42 54 69 85 99
    	12 のぞき 1 3 6 10 17 24 32 42 55 69
    	13 レズプレイ 1 2 4 8 13 19 27 36 45 58 69 99
    	14 輪姦 1 4 8 15 22 30 42 55 69 99
    	15 逆レイプ 1 4 10 15 25 40 52 69
    	16 中出し 1 2 4 10 18 30 42 55 69 85 99 125
    	17 妊娠 1 2 4 7 10 14 18 24 30 36 42 50
    */

	//HValuesReq is a double array holding all the H requirements
	//HValuesReq[x][y]
	//x = Ingame variable key
	//y = H Requirement
    var hValuesReq = [ 0 ];
    for (i = 1; i < hValues.length; i++) { hValuesReq[i] = i; }

    hValuesReq[1] = [ 2, 6, 12, 20, 35, 50, 69, 85, 99, 120, 145, 170, 200 ];
	hValuesReq[2] = [ 1, 3, 8, 14, 20, 30, 42, 54, 69, 99 ];
	hValuesReq[3] = [ 1, 2, 4, 7, 12, 25, 38, 50, 69, 99 ];
	hValuesReq[4] = [ 1, 3, 5, 10, 17, 25, 32, 40, 50 ];
	hValuesReq[5] = [ 1, 2, 6, 11, 18, 30, 42, 55, 69, 99 ];
	hValuesReq[6] = [ 1, 3, 6, 10, 17, 24, 32, 42, 55, 69 ];
	hValuesReq[7] = [ 1, 3, 5, 10, 17, 25, 32, 40, 50 ];
	hValuesReq[8] = [ 1, 3, 6, 12, 20, 30, 42, 55, 69, 85, 99, 125 ];
	hValuesReq[9] = [ 3, 5, 9 ,14, 20, 28, 40, 52, 69, 99 ];
    hValuesReq[10] = [ 1, 2, 5, 10, 16, 24, 34, 48, 60, 75 ];
	hValuesReq[11] = [ 1, 2, 4, 8, 14, 20, 30, 42, 54, 69, 85, 99 ];
	hValuesReq[12] = [ 1, 3, 6 ,10, 17, 24, 32, 42, 55, 69 ];
	hValuesReq[13] = [ 1, 2, 4, 8, 13, 19, 27, 36, 45, 58, 69, 99 ];
	hValuesReq[14] = [ 1, 4, 8, 15, 22, 30, 42, 55, 69, 99 ];
	hValuesReq[15] = [ 1, 4, 10, 15, 25, 40, 52, 69 ];
	hValuesReq[16] = [ 1, 2, 4, 10, 18, 30, 42, 55, 69, 85, 99, 125 ];
	hValuesReq[17] = [ 1, 2, 4, 7, 10, 14, 18, 24, 30, 36, 42, 50 ];

	for (i = 0; i < hValues.length; i++) {
    	if(i===17) {
        	//the color of the bitch level
        	hWindow.changeTextColor('rgba(255, 76, 130, 1)');
        	hValues[i] = "" + $gameVariables.value((hValueID[i])) + "";
        	hWindow.drawText(hValues[i], hTextWidth[3], hTextHeight[i], valueWidth, 'right');
        	hWindow.resetTextColor();
    	}
    	else {
        	hValues[i] = "" + $gameVariables.value((hValueID[i])) + "";

        	hWindow.drawText(hValues[i], hTextWidth[0], hTextHeight[i], valueWidth, 'right');

        	if(hasOrb) {
            	hWindow.drawText("/", hTextWidth[1], hTextHeight[i], valueWidth, 'right');

            	//the color of the H requirements
            	hWindow.changeTextColor('rgba(255, 153, 229, 1)');

            	var hReq = 0;

            	for(j = 0; j < hValuesReq[hValueID[i]].length; j++) {
                	if(hValuesReq[hValueID[i]][j] > $gameVariables.value((hValueID[i]))) {
                    	hReq = hValuesReq[hValueID[i]][j];
                    	break;
                	}
            	}

            	var hReqText = "";
				var reqWidth = hTextWidth[2];
				if(hReq === 0) {
					hReqText = "♥";
					reqWidth += 0;
				}
				else {    hReqText = "" + hReq;  }
				hWindow.drawText(hReqText, reqWidth, hTextHeight[i], valueWidth, 'right');
				hWindow.resetTextColor();
        	}
    	}

	}

//素材

	var mTextWidth = 655;

    //mCount is the string that will hold the current count of each Material
    var mCount = [];
    mCount.length = 18;

    //mCountID is what each menu item starting top to bottom correlates to the ingame variable key
	//Japanese order
    //var mCountID = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 ];
	//English order
	var mCountID = [ 1, 2, 3, 9, 11, 4, 5, 10, 17, 6, 7, 8, 12, 13, 14, 15, 16, 18 ];

	for (i = 0; i < mCount.length; i++) {
		mCount[i] = "" + $gameParty.numItems($dataItems[mCountID[i]]) + "";
		hWindow.drawText(mCount[i], mTextWidth, hTextHeight[i], valueWidth, 'right');
	}

	delete hWindow;
};

//=============================================================================
// メニュー背景
//=============================================================================

(function() {

        var _Scene_Menu_createBackground = Scene_Menu.prototype.createBackground;
        Scene_Menu.prototype.createBackground = function(){
            _Scene_Menu_createBackground.call(this);

            this._backgroundSprite = new Sprite();
            this._backgroundSprite.bitmap =
             ImageManager.loadPicture('menu1_status');
            this.addChild(this._backgroundSprite);
        }

    })();

//=============================================================================
// バトルコマンド
//=============================================================================

Window_ActorCommand.prototype.maxCols = function() {
        return 2;
    };

//=============================================================================
// 着替え
//=============================================================================

    Window_EventItem.prototype.maxCols = function() {
        return 1;
    };

//=============================================================================
// 移動速度
//=============================================================================

Game_CharacterBase.prototype.distancePerFrame = function() {
    return Math.pow(2, this.realMoveSpeed()) / 210;
};

//=============================================================================
// メニューぼかし解除
//=============================================================================

SceneManager.snapForBackground = function() {
    this._backgroundBitmap = this.snap();
    //this._backgroundBitmap.blur();
};

//=============================================================================
// アイテム使用時
//=============================================================================

Window_MenuStatus.prototype.drawItemStatus = function(index) {
    var actor = $gameParty.members()[index];
    var rect = this.itemRect(index);
    var x = rect.x + 10;
    var y = rect.y + 0;
    var width = rect.width - x - this.textPadding();
    this.drawActorSimpleStatus(actor, x, y, width);
};

//=============================================================================
// スクロール文章
//=============================================================================

(function () {
	Window_ScrollText.prototype.refresh = function() {
		var textState = { index: 0 };
		textState.text = this.convertEscapeCharacters(this._text);
		this.resetFontSettings();
		this._allTextHeight = this.calcTextHeight(textState, true);
		this.createContents();
		this.move(0,0,this.width,this._allTextHeight + this.standardPadding() * 2)
		this._windowContentsSprite.y = Graphics.boxHeight;
		this.drawTextEx(this._text, this.textPadding(), 1);
	};

	Window_ScrollText.prototype.updateMessage = function() {
		this._windowContentsSprite.y -= this.scrollSpeed();
		if (this._windowContentsSprite.y <= -this.contents.height) {
			this.terminateMessage();
		}
	};
})();

//=============================================================================
// バトルのステートアイコン位置
//=============================================================================

Window_BattleStatus.prototype.drawBasicArea = function(rect, actor) {
//    this.drawActorName(actor, rect.x + 0, rect.y, 150);
    this.drawActorIcons(actor, rect.x + 635, rect.y, rect.width - 156);
};

Window_BattleStatus.prototype.drawGaugeAreaWithoutTp = function(rect, actor) {
    this.drawActorHp(actor, rect.x - 400, rect.y, 360);
    this.drawActorMp(actor, rect.x - 20,  rect.y, 160);
};

//=============================================================================
// バトル表情
//=============================================================================

  var _Game_Actor_performDamage = Game_Actor.prototype.performDamage;
  Game_Actor.prototype.performDamage = function() {
    _Game_Actor_performDamage.call(this);
     $gameScreen.showPicture(2,'battle_face_damage',0,0,636,100,100,255,0);
};

  var _Game_Actor_performAction = Game_Actor.prototype.performAction;
  Game_Actor.prototype.performAction = function(action) {
    _Game_Actor_performAction.call(this, action);
    if (action.isAttack()) {
     $gameScreen.showPicture(2,'battle_face_attack',0,0,636,100,100,255,0);
    } else if (action.isMagicSkill() && action.isHpRecover()) {
     $gameScreen.showPicture(2,'battle_face_heal',0,0,636,100,100,255,0);
    } else if (action.isMagicSkill() && action.isForFriend()) {
     $gameScreen.showPicture(2,'battle_face_buff',0,0,636,100,100,255,0);
    } else if (action.isMagicSkill()) {
     $gameScreen.showPicture(2,'battle_face_skill',0,0,636,100,100,255,0);
    } else if (action.isSkill() && !action.isGuard()) {
     $gameScreen.showPicture(2,'battle_face_skill',0,0,636,100,100,255,0);
    }
  };

  var _BattleManager_processVictory = BattleManager.processVictory;
  BattleManager.processVictory = function() {
   $gameScreen.showPicture(3,'battle_face_win',0,0,636,100,100,255,0);
    _BattleManager_processVictory.call(this);
  };

  var _BattleManager_endTurn = BattleManager.endTurn;
  BattleManager.endTurn = function() {
     $gameScreen.erasePicture(2);
    _BattleManager_endTurn.call(this);
  };

  var _Game_Actor_performCollapse = Game_Actor.prototype.performCollapse;
  Game_Actor.prototype.performCollapse = function() {
    _Game_Actor_performCollapse.call(this);
     $gameScreen.showPicture(3,'battle_face_lose',0,0,636,100,100,255,0);
};

//=============================================================================
// 経験値1.5倍
//=============================================================================

BattleManager.makeRewards = function() {
    this._rewards = {};

	var goldMultiplier = 1;
	if ($gameSwitches.value(203) === true) {
		goldMultiplier += 0.5;
	}
	if ($gameActors.actor(1).equips()[1]) {
		if($gameActors.actor(1).equips()[1].id == 1 ) {
			goldMultiplier += 0.5;
		}
	}

    this._rewards.gold = Math.floor($gameTroop.goldTotal() * goldMultiplier);

	var expMultiplier = 1;

    if ($gameSwitches.value(204) === true) {
        expMultiplier += 0.5;
    }
	if ($gameActors.actor(1).equips()[2]) {
        if($gameActors.actor(1).equips()[2].id == 41 ) {
			expMultiplier += 0.25;
		}
    }

	this._rewards.exp = Math.floor($gameTroop.expTotal() * expMultiplier);

    this._rewards.items = $gameTroop.makeDropItems();
};

//=============================================================================
// エンディング→コンティニュースイッチ
//=============================================================================

(function() {

    var _Scene_Load_onLoadSuccess = Scene_Load.prototype.onLoadSuccess;
    Scene_Load.prototype.onLoadSuccess = function() {
        _Scene_Load_onLoadSuccess.call(this);
        // エンディングセーブ直前に入れておくスイッチ
        if($gameSwitches.value(200)){
        // コンティニュー後自動的に入るスイッチ
        $gameSwitches.setValue(199, true);
        }
    };

})();

//-----------------------------------------------------------------------------
// Window_EquipItem

Window_EquipItem.prototype.initialize = function(x, y, width, height) {
    Window_ItemList.prototype.initialize.call(this, x, y, width, height);
    this._actor = null;
    this._slotId = 0;
	this._category = 'equipList';
};

Window_ItemList.prototype.maxCols = function() {
    if(this._category === 'equipList') {
		return 3;
	}
	else {
		return 2;
	}
};

Window_ItemList.prototype.drawItem = function(index) {
    var item = this._data[index];
    if (item) {
        var numberWidth = this.numberWidth();
        var rect = this.itemRect(index);
        rect.width -= this.textPadding();
        this.changePaintOpacity(this.isEnabled(item));
		if(this._category === 'equipList') {
			this.drawItemName(item, rect.x, rect.y, rect.width);
		}
		else {
			this.drawItemName(item, rect.x, rect.y, rect.width - numberWidth);
			this.drawItemNumber(item, rect.x, rect.y, rect.width);
		}
        this.changePaintOpacity(1);
    }
};

//--------Guard

Game_Action.prototype.applyGuard = function(damage, target) {
    var guardMultipler = 2;

	if ($gameActors.actor(1).equips()[1]) {
		if($gameActors.actor(1).equips()[1].id == 12 ) {
			guardMultipler = 3;
		}
	}

	return damage / (damage > 0 && target.isGuard() ? guardMultipler * target.grd : 1);
};

//--------Disable F5

SceneManager.onKeyDown = function(event) {
    if (!event.ctrlKey && !event.altKey) {
        switch (event.keyCode) {
        case 116:   // F5
            if (Utils.isNwjs()) {
                //location.reload();
            }
            break;
        case 119:   // F8
            if (Utils.isNwjs() && Utils.isOptionValid('test')) {
                require('nw.gui').Window.get().showDevTools();
            }
            break;
        }
    }
};

//=============================================================================
// Game_Action
//=============================================================================

Game_Action.prototype.makeDamageValue = function(target, critical) {
  var item = this.item();
  var a = this.subject();
  var b = target;
  var user = this.subject();
  var s = $gameSwitches._data;
  var v = $gameVariables._data;
  var baseDamage = this.evalDamageFormula(target);
  var value = baseDamage;
  try {
    eval(Yanfly.DMG.DamageFlow);
  } catch (e) {
    Yanfly.Util.displayError(e, Yanfly.DMG.DamageFlow, 'DAMAGE FLOW ERROR');
  }

  if(value > 0 && value < 0.99) {
	value = 1;
  }
  if(critical &&  value < 1.5 ) {
	value = 2;
  }

  return Math.round(value);
};


code:
/*:
 * @plugindesc <AntiAudioDelay> for RPG Maker MV version 1.6.2.
 * @author RPG Maker Irina
 *
 * @help
 * *** Introduction ***
 *
 * When playing audio in RPG Maker MV events, there's a small delay when the
 * audio loads to when it's actually played. This can make some scenes lose
 * impact where an emotional piece of music is supposed to be played, but it
 * gets delayed instead and ruins the moment.
 *
 * What this plugin does is go through the currently running event's command
 * list by a certain amount and loads ahead of time the audio files it finds.
 * This way, the audio files are ready by the time the event runs, making it
 * transition smoothly.
 *
 * This plugin does not preload and store audio files forever because that's a
 * very quick way to get your game client to crash when it consumes more memory
 * than the player's computer can handle. Instead, it will save a designated
 * amount of audio files in its cache to keep them ready in case they're reused
 * but will flush them out of memory when the limit has been reached. This is
 * to ensure that memory doesn't overflow and crash the game.
 *
 *
 *
 * *** Plugin Parameters ***
 *
 * Load Ahead Index By
 *
 *      This is how many event lines the plugin will look ahead to search for
 * audio files to load into the cache. Keep in mind this is lines, not actual
 * event commands. Events that have multiple lines like messages will count for
 * a different amount of lines. Therefore, it's safe to have this look ahead by
 * a large number like 10.
 *
 * Cache Limits
 *
 *      Each of these for BGM, BGS, ME, and SE all do the same thing: store a
 * number of audio files in quick accessible memory for the game client to use
 * and call when needed. If the amount exceeds the limit declared on the plugin
 * parameter, then the oldest entries will be flushed out of memory until the
 * cache is at the limit amount.
 *
 *
 *
 * *** Plugin Commands ***
 *
 * FlushAudioCache BGM
 * FlushAudioCache BGS
 * FlushAudioCache ME
 * FlushAudioCache SE
 * FlushAudioCache ALL
 *
 *      These will clear the audio caches for the written type of audio. If you
 * pick all, then all four types will be flushed out of memory. This will give
 * your game a clear slate for the the audio cache, which means the game may
 * lag a little bit upon reloading the new BGM files.
 *
 *      In my opinion, these plugin commands should never need to be used since
 * the plugin will automatically clear them once the cache goes over the limit,
 * but I'm just giving you control over the audio cache for your game just in
 * case you want to do something with it.
 *
 *
 *
 * *** RPG Maker Version ***
 *
 * This plugin is made for and tested on RPG Maker MV with version 1.6.2.
 * I cannot guarantee if it works on lower versions.
 *
 *
 *
 * *** Terms of Use ***
 *
 * 1. These plugins may be used in free or commercial games.
 * 2. 'RPG Maker Irina' must be given credit in your games.
 * 3. You are allowed to edit the code.
 * 4. Do NOT change the filename, parameters, and information of the plugin.
 * 5. You are NOT allowed to redistribute these Plugins.
 * 6. You may NOT take code for your own released Plugins.
 *
 * *** Help End ***
 *
 * @param
 *
 * @param LoadAheadIndex
 * @text Load Ahead Index By
 * @desc Load BGM, BGS, ME, SE audio in a running event ahead by this count for the event index
 * @default 10
 *
 * @param
 *
 * @param CacheLimits
 * @text Cache Limits
 *
 * @param CacheLimitBgm
 * @text BGM
 * @parent CacheLimits
 * @desc Store this many BGM in the cache before removing the earlier ones
 * @default 10
 *
 * @param CacheLimitBgs
 * @text BGS
 * @parent CacheLimits
 * @desc Store this many BGS in the cache before removing the earlier ones
 * @default 10
 *
 * @param CacheLimitMe
 * @text ME
 * @parent CacheLimits
 * @desc Store this many ME in the cache before removing the earlier ones
 * @default 10
 *
 * @param CacheLimitSe
 * @text SE
 * @parent CacheLimits
 * @desc Store this many SE in the cache before removing the earlier ones
 * @default 10
 *
 */
//=============================================================================
var parameters = $plugins.filter(function(e) {
    return e.description.contains("<AntiAudioDelay>");
})[0].parameters;
var Imported = Imported || {};
Imported.Irina_AntiAudioDelay = {
    LoadAheadIndex: Number(parameters["LoadAheadIndex"]),
    CacheLimitBgm: Number(parameters["CacheLimitBgm"]),
    CacheLimitBgs: Number(parameters["CacheLimitBgs"]),
    CacheLimitMe: Number(parameters["CacheLimitMe"]),
    CacheLimitSe: Number(parameters["CacheLimitSe"]),
};
Imported.Irina_AntiAudioDelay.AudioManager_playBgm = AudioManager.playBgm;
AudioManager.playBgm = function(e, a) {
    Imported.Irina_AntiAudioDelay.AudioManager_playBgm.call(this, e, a);
    if (e) {
        var i = e.name;
        this._lastLoadedBgm = this._lastLoadedBgm || [];
        this._lastLoadedBgm.push(i);
        var t = Imported.Irina_AntiAudioDelay.CacheLimitBgm;
        while (this._lastLoadedBgm.length > t) {
            var i = this._lastLoadedBgm.shift();
            if (this._lastLoadedBgm.contains(i)) continue;
            if (this._audioCacheBgm[i] && i !== AudioManager._battleBgmName && i !== AudioManager._vehicleBgmName) {
                this._audioCacheBgm[i].clear();
                this._audioCacheBgm[i] = undefined;
            }
        }
    }
};
Imported.Irina_AntiAudioDelay.AudioManager_playBgs = AudioManager.playBgs;
AudioManager.playBgs = function(e, a) {
    Imported.Irina_AntiAudioDelay.AudioManager_playBgs.call(this, e, a);
    if (e) {
        var i = e.name;
        this._lastLoadedBgs = this._lastLoadedBgs || [];
        this._lastLoadedBgs.push(i);
        var t = Imported.Irina_AntiAudioDelay.CacheLimitBgs;
        while (this._lastLoadedBgs.length > t) {
            var i = this._lastLoadedBgs.shift();
            if (this._lastLoadedBgs.contains(i)) continue;
            if (this._audioCacheBgs[i]) {
                this._audioCacheBgs[i].clear();
                this._audioCacheBgs[i] = undefined;
            }
        }
    }
};
Imported.Irina_AntiAudioDelay.AudioManager_playMe = AudioManager.playMe;
AudioManager.playMe = function(e) {
    Imported.Irina_AntiAudioDelay.AudioManager_playMe.call(this, e);
    if (e) {
        var a = e.name;
        this._lastLoadedMe = this._lastLoadedMe || [];
        this._lastLoadedMe.push(a);
        var i = Imported.Irina_AntiAudioDelay.CacheLimitMe;
        while (this._lastLoadedMe.length > i) {
            var a = this._lastLoadedMe.shift();
            if (this._lastLoadedMe.contains(a)) continue;
            if (this._audioCacheMe[a] && a !== AudioManager._victoryMeName && a !== AudioManager._defeatMeName) {
                this._audioCacheMe[a].clear();
                this._audioCacheMe[a] = undefined;
            }
        }
    }
};
Imported.Irina_AntiAudioDelay.AudioManager_playSe = AudioManager.playSe;
AudioManager.playSe = function(e) {
    Imported.Irina_AntiAudioDelay.AudioManager_playSe.call(this, e);
    if (e) {
        var a = e.name;
        this._lastLoadedSe = this._lastLoadedSe || [];
        this._lastLoadedSe.push(a);
        var i = Imported.Irina_AntiAudioDelay.CacheLimitSe;
        while (this._lastLoadedSe.length > i) {
            var a = this._lastLoadedSe.shift();
            if (this._lastLoadedSe.contains(a)) continue;
            if (this._audioCacheSe[a]) {
                this._audioCacheSe[a].clear();
                this._audioCacheSe[a] = undefined;
            }
        }
    }
};
Imported.Irina_AntiAudioDelay.AudioManager_createBuffer = AudioManager.createBuffer;
AudioManager.createBuffer = function(e, a) {
    switch (e) {
        case "bgm":
            this._audioCacheBgm = this._audioCacheBgm || {};
            var i = this._audioCacheBgm;
            break;
        case "bgs":
            this._audioCacheBgs = this._audioCacheBgs || {};
            var i = this._audioCacheBgs;
            break;
		case "voice":
            this._audioCacheVoice = this._audioCacheVoice || {};
            var i = this._audioCacheVoice;
            break;
		case "moan":
            this._audioCacheMoan = this._audioCacheMoan || {};
            var i = this._audioCacheMoan;
            break;
        case "me":
            this._audioCacheMe = this._audioCacheMe || {};
            var i = this._audioCacheMe;
            break;
        case "se":
            this._audioCacheSe = this._audioCacheSe || {};
            var i = this._audioCacheSe;
            break;
		case "enemy":
            this._audioCacheEnemy = this._audioCacheEnemy || {};
            var i = this._audioCacheEnemy;
            break;
        default:
            return Imported.Irina_AntiAudioDelay.AudioManager_createBuffer.call(this);
    }
    if(!i[a]) {
        i[a] = Imported.Irina_AntiAudioDelay.AudioManager_createBuffer.call(this, e, a);
    }
	else if(e === 'se' && i[a].isPlaying()) {
		i[a] = Imported.Irina_AntiAudioDelay.AudioManager_createBuffer.call(this, e, a);
	}

    return i[a];
};
AudioManager.flushAudioCache = function(e) {
    if (e === "bgm") {
        this._audioCacheBgm = {};
    } else if (e === "bgs") {
        this._audioCacheBgs = {};
	} else if (e === "voice") {
        this._audioCacheVoice = {};
	} else if (e === "moan") {
        this._audioCacheMoan = {};
    } else if (e === "me") {
        this._audioCacheMe = {};
	} else if (e === "enemy") {
        this._audioCacheEnemy = {};
    } else if (e === "se") {
        this._audioCacheSe = {};
    }
};
Imported.Irina_AntiAudioDelay.Game_Interpreter_executeCommand = Game_Interpreter.prototype.executeCommand;
Game_Interpreter.prototype.executeCommand = function() {
    this.loadAheadAudioCommands();
    return Imported.Irina_AntiAudioDelay.Game_Interpreter_executeCommand.call(this);
};
Game_Interpreter.prototype.loadAheadAudioCommands = function() {
    var e = Imported.Irina_AntiAudioDelay.LoadAheadIndex;
    if (e > 0) {
        var a = this._index;
        var i = this._index + e;
        for (var t = i; t >= a; t--) {
            var d = this._list[t];
            if (d && d.code) {
                var r = d.parameters;
                switch (d.code) {
                    case 241:
						if(r[0].name && r[0].name.length > 0) {
							AudioManager.createBuffer("bgm", r[0].name);
						}
                        break;
                    case 245:
						if(r[0].name && r[0].name.length > 0) {
							AudioManager.createBuffer("bgs", r[0].name);
						}
                        break;
                    case 249:
						if(r[0].name && r[0].name.length > 0) {
							AudioManager.createBuffer("me", r[0].name);
						}
                        break;
                    case 250:
						if(r[0].name && r[0].name.length > 0) {
							AudioManager.createBuffer("se", r[0].name);
						}
                        break;
                    case 132:
                        if (AudioManager._battleBgmName !== undefined && AudioManager._audioCacheBgm[AudioManager._battleBgmName]) {
                            AudioManager._audioCacheBgm[AudioManager._battleBgmName].clear();
                            AudioManager._audioCacheBgm[AudioManager._battleBgmName] = undefined;
                        }
                        AudioManager._battleBgmName = r[0].name;
                        if (AudioManager._battleBgmName !== "") {
                            AudioManager._battleBgmBuffer = AudioManager.createBuffer("bgm", r[0].name)
                        }
                        break;
                    case 133:
                        if (AudioManager._victoryMeName !== undefined && AudioManager._audioCacheBgm[AudioManager._victoryMeName]) {
                            AudioManager._audioCacheMe[AudioManager._victoryMeName].clear();
                            AudioManager._audioCacheMe[AudioManager._victoryMeName] = undefined;
                        }
                        AudioManager._victoryMeName = r[0].name;
                        if (AudioManager._victoryMeName !== "") {
                            AudioManager._victoryMeBuffer = AudioManager.createBuffer("me", r[0].name)
                        }
                        break;
                    case 139:
                        if (AudioManager._defeatMeName !== undefined && AudioManager._audioCacheBgm[AudioManager._defeatMeName]) {
                            AudioManager._audioCacheMe[AudioManager._defeatMeName].clear();
                            AudioManager._audioCacheMe[AudioManager._defeatMeName] = undefined;
                        }
                        AudioManager._defeatMeName = r[0].name;
                        if (AudioManager._defeatMeName !== "") {
                            AudioManager._defeatMeBuffer = AudioManager.createBuffer("me", r[0].name);
                        }
                        break;
                    case 301:
                        if ($gameSystem.battleBgm().name !== "") {
                            AudioManager.createBuffer("bgm", $gameSystem.battleBgm().name);
                        }
                        if ($gameSystem.victoryMe().name !== "") {
                            AudioManager.createBuffer("me", $gameSystem.victoryMe().name);
                        }
                        if ($gameSystem.defeatMe().name !== "") {
                            AudioManager.createBuffer("me", $gameSystem.defeatMe().name);
                        }
                        break;
                }
            }
        }
    }
};
Imported.Irina_AntiAudioDelay.BattleManager_playBattleBgm = BattleManager.playBattleBgm;
BattleManager.playBattleBgm = function() {
    Imported.Irina_AntiAudioDelay.BattleManager_playBattleBgm.call(this);
    if (AudioManager._battleBgmName !== $gameSystem.battleBgm().name) {
        if (AudioManager._audioCacheBgm[AudioManager._battleBgmName]) {
            AudioManager._audioCacheBgm[AudioManager._battleBgmName].clear();
            AudioManager._audioCacheBgm[AudioManager._battleBgmName] = undefined;
        }
        AudioManager._battleBgmName = $gameSystem.battleBgm();
    }
};
Imported.Irina_AntiAudioDelay.BattleManager_playVictoryMe = BattleManager.playVictoryMe;
BattleManager.playVictoryMe = function() {
    Imported.Irina_AntiAudioDelay.BattleManager_playVictoryMe.call(this);
    if (AudioManager._victoryMeName !== $gameSystem.victoryMe().name) {
        if (AudioManager._audioCacheMe[AudioManager._victoryMeName]) {
            AudioManager._audioCacheMe[AudioManager._victoryMeName].clear();
            AudioManager._audioCacheMe[AudioManager._victoryMeName] = undefined;
        }
        AudioManager._victoryMeName = $gameSystem.victoryMe();
    }
};
Imported.Irina_AntiAudioDelay.BattleManager_playDefeatMe = BattleManager.playDefeatMe;
BattleManager.playDefeatMe = function() {
    Imported.Irina_AntiAudioDelay.BattleManager_playDefeatMe.call(this);
    if (AudioManager._defeatMeName !== $gameSystem.defeatMe().name) {
        if (AudioManager._audioCacheMe[AudioManager._defeatMeName]) {
            AudioManager._audioCacheMe[AudioManager._defeatMeName].clear();
            AudioManager._audioCacheMe[AudioManager._defeatMeName] = undefined;
        }
        AudioManager._defeatMeName = $gameSystem.defeatMe();
    }
};
Imported.Irina_AntiAudioDelay.Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(e, a) {
    Imported.Irina_AntiAudioDelay.Game_Interpreter_pluginCommand.call(this, e, a);
    if (e.match(/FlushAudioCache/i)) {
        var i = a[0];
        if (i.match(/bgm/i)) {
            AudioManager.flushAudioCache("bgm");
        } else if (i.match(/bgs/i)) {
            AudioManager.flushAudioCache("bgs");
        } else if (i.match(/me/i)) {
            AudioManager.flushAudioCache("me");
        } else if (i.match(/se/i)) {
            AudioManager.flushAudioCache("se");
		} else if (i.match(/enemy/i)) {
            AudioManager.flushAudioCache("enemy");
		} else if (i.match(/voice/i)) {
            AudioManager.flushAudioCache("voice");
		} else if (i.match(/moan/i)) {
            AudioManager.flushAudioCache("moan");
        } else if (i.match(/all/i)) {
            AudioManager.flushAudioCache("bgm");
            AudioManager.flushAudioCache("bgs");
            AudioManager.flushAudioCache("me");
            AudioManager.flushAudioCache("se");
			AudioManager.flushAudioCache("enemy");
			AudioManager.flushAudioCache("voice");
			AudioManager.flushAudioCache("moan");
        }
    }
};

license: unknown


code:
//=============================================================================
// ItemBook.js
//=============================================================================

/*:
 * @plugindesc Displays detailed statuses of items.
 * @author Yoji Ojima
 *
 * @param Unknown Data
 * @desc The index name for an unknown item.
 * @default ??????
 *
 * @param Price Text
 * @desc The text for "Price".
 * @default Price
 *
 * @param Equip Text
 * @desc The text for "Equip".
 * @default Equip
 *
 * @param Type Text
 * @desc The text for "Type".
 * @default Type
 *
 * @help
 *
 * Plugin Command:
 *   ItemBook open            # Open the item book screen
 *   ItemBook add weapon 3    # Add weapon #3 to the item book
 *   ItemBook add armor 4     # Add armor #4 to the item book
 *   ItemBook remove armor 5  # Remove armor #5 from the item book
 *   ItemBook remove item 6   # Remove item #6 from the item book
 *   ItemBook complete        # Complete the item book
 *   ItemBook clear           # Clear the item book
 *
 * Item (Weapon, Armor) Note:
 *   <book:no>                # This item does not appear in the item book
 */

/*:ja
 * @plugindesc アイテム図鑑です。アイテムの詳細なステータスを表示します。
 * @author Yoji Ojima
 *
 * @param Unknown Data
 * @desc 未確認のアイテムの索引名です。
 * @default ？？？？？？
 *
 * @param Price Text
 * @desc 「価格」の文字列です。
 * @default 価格
 *
 * @param Equip Text
 * @desc 「装備」の文字列です。
 * @default 装備
 *
 * @param Type Text
 * @desc 「タイプ」の文字列です。
 * @default タイプ
 *
 * @help
 *
 * プラグインコマンド:
 *   ItemBook open            # 図鑑画面を開く
 *   ItemBook add weapon 3    # 武器３番を図鑑に追加
 *   ItemBook add armor 4     # 防具４番を図鑑に追加
 *   ItemBook remove armor 5  # 防具５番を図鑑から削除
 *   ItemBook remove item 6   # アイテム６番を図鑑から削除
 *   ItemBook complete        # 図鑑を完成させる
 *   ItemBook clear           # 図鑑をクリアする
 *
 * アイテム（武器、防具）のメモ:
 *   <book:no>                # 図鑑に載せない場合
 */

(function() {

    var parameters = PluginManager.parameters('ItemBook');
    var unknownData = String(parameters['Unknown Data'] || '??????');
    var priceText = String(parameters['Price Text'] || 'Price');
    var equipText = String(parameters['Equip Text'] || 'Equip');
    var typeText = String(parameters['Type Text'] || 'Type');

    var _Game_Interpreter_pluginCommand =
            Game_Interpreter.prototype.pluginCommand;
    Game_Interpreter.prototype.pluginCommand = function(command, args) {
        _Game_Interpreter_pluginCommand.call(this, command, args);
        if (command === 'ItemBook') {
            switch (args[0]) {
            case 'open':
                SceneManager.push(Scene_ItemBook);
                break;
            case 'add':
                $gameSystem.addToItemBook(args[1], Number(args[2]));
                break;
            case 'remove':
                $gameSystem.removeFromItemBook(args[1], Number(args[2]));
                break;
            case 'complete':
                $gameSystem.completeItemBook();
                break;
            case 'clear':
                $gameSystem.clearItemBook();
                break;
            }
        }
    };

    Game_System.prototype.addToItemBook = function(type, dataId) {
        if (!this._ItemBookFlags) {
            this.clearItemBook();
        }
        var typeIndex = this.itemBookTypeToIndex(type);
        if (typeIndex >= 0) {
            this._ItemBookFlags[typeIndex][dataId] = true;
        }
    };

    Game_System.prototype.removeFromItemBook = function(type, dataId) {
        if (this._ItemBookFlags) {
            var typeIndex = this.itemBookTypeToIndex(type);
            if (typeIndex >= 0) {
                this._ItemBookFlags[typeIndex][dataId] = false;
            }
        }
    };

    Game_System.prototype.itemBookTypeToIndex = function(type) {
        switch (type) {
        case 'item':
            return 0;
        case 'weapon':
            return 1;
        case 'armor':
            return 2;
        default:
            return -1;
        }
    };

    Game_System.prototype.completeItemBook = function() {
        var i;
        this.clearItemBook();
        for (i = 1; i < $dataItems.length; i++) {
            this._ItemBookFlags[0][i] = true;
        }
        for (i = 1; i < $dataWeapons.length; i++) {
            this._ItemBookFlags[1][i] = true;
        }
        for (i = 1; i < $dataArmors.length; i++) {
            this._ItemBookFlags[2][i] = true;
        }
    };

    Game_System.prototype.clearItemBook = function() {
        this._ItemBookFlags = [[], [], []];
    };

    Game_System.prototype.isInItemBook = function(item) {
        if (this._ItemBookFlags && item) {
            var typeIndex = -1;
            if (DataManager.isItem(item)) {
                typeIndex = 0;
            } else if (DataManager.isWeapon(item)) {
                typeIndex = 1;
            } else if (DataManager.isArmor(item)) {
                typeIndex = 2;
            }
            if (typeIndex >= 0) {
                return !!this._ItemBookFlags[typeIndex][item.id];
            } else {
                return false;
            }
        } else {
            return false;
        }
    };

    var _Game_Party_gainItem = Game_Party.prototype.gainItem;
    Game_Party.prototype.gainItem = function(item, amount, includeEquip) {
        _Game_Party_gainItem.call(this, item, amount, includeEquip);
        if (item && amount > 0) {
            var type;
            if (DataManager.isItem(item)) {
                type = 'item';
            } else if (DataManager.isWeapon(item)) {
                type = 'weapon';
            } else if (DataManager.isArmor(item)) {
                type = 'armor';
            }
            $gameSystem.addToItemBook(type, item.id);
        }
    };

    function Scene_ItemBook() {
        this.initialize.apply(this, arguments);
    }

    Scene_ItemBook.prototype = Object.create(Scene_MenuBase.prototype);
    Scene_ItemBook.prototype.constructor = Scene_ItemBook;

    Scene_ItemBook.prototype.initialize = function() {
        Scene_MenuBase.prototype.initialize.call(this);
    };

    Scene_ItemBook.prototype.create = function() {
        Scene_MenuBase.prototype.create.call(this);
        this._indexWindow = new Window_ItemBookIndex(0, 0);
        this._indexWindow.setHandler('cancel', this.popScene.bind(this));
        var wy = this._indexWindow.height;
        var ww = Graphics.boxWidth;
        var wh = Graphics.boxHeight - wy;
        this._statusWindow = new Window_ItemBookStatus(0, wy, ww, wh);
        this.addWindow(this._indexWindow);
        this.addWindow(this._statusWindow);
        this._indexWindow.setStatusWindow(this._statusWindow);
    };

    function Window_ItemBookIndex() {
        this.initialize.apply(this, arguments);
    }

    Window_ItemBookIndex.prototype = Object.create(Window_Selectable.prototype);
    Window_ItemBookIndex.prototype.constructor = Window_ItemBookIndex;

    Window_ItemBookIndex.lastTopRow = 0;
    Window_ItemBookIndex.lastIndex  = 0;

    Window_ItemBookIndex.prototype.initialize = function(x, y) {
        var width = Graphics.boxWidth;
        var height = this.fittingHeight(6);
        Window_Selectable.prototype.initialize.call(this, x, y, width, height);
        this.refresh();
        this.setTopRow(Window_ItemBookIndex.lastTopRow);
        this.select(Window_ItemBookIndex.lastIndex);
        this.activate();
    };

    Window_ItemBookIndex.prototype.maxCols = function() {
        return 3;
    };

    Window_ItemBookIndex.prototype.maxItems = function() {
        return this._list ? this._list.length : 0;
    };

    Window_ItemBookIndex.prototype.setStatusWindow = function(statusWindow) {
        this._statusWindow = statusWindow;
        this.updateStatus();
    };

    Window_ItemBookIndex.prototype.update = function() {
        Window_Selectable.prototype.update.call(this);
        this.updateStatus();
    };

    Window_ItemBookIndex.prototype.updateStatus = function() {
        if (this._statusWindow) {
            var item = this._list[this.index()];
            this._statusWindow.setItem(item);
        }
    };

    Window_ItemBookIndex.prototype.refresh = function() {
        var i, item;
        this._list = [];
        for (i = 1; i < $dataItems.length; i++) {
            item = $dataItems[i];
            if (item.name && item.itypeId === 1 && item.meta.book !== 'no') {
                this._list.push(item);
            }
        }
        for (i = 1; i < $dataWeapons.length; i++) {
            item = $dataWeapons[i];
            if (item.name && item.meta.book !== 'no') {
                this._list.push(item);
            }
        }
        for (i = 1; i < $dataArmors.length; i++) {
            item = $dataArmors[i];
            if (item.name && item.meta.book !== 'no') {
                this._list.push(item);
            }
        }
        this.createContents();
        this.drawAllItems();
    };

    Window_ItemBookIndex.prototype.drawItem = function(index) {
        var item = this._list[index];
        var rect = this.itemRect(index);
        var width = rect.width - this.textPadding();
        if ($gameSystem.isInItemBook(item)) {
            this.drawItemName(item, rect.x, rect.y, width);
        } else {
            var iw = Window_Base._iconWidth + 4;
            this.drawText(unknownData, rect.x + iw, rect.y, width - iw);
        }
    };

    Window_ItemBookIndex.prototype.processCancel = function() {
        Window_Selectable.prototype.processCancel.call(this);
        Window_ItemBookIndex.lastTopRow = this.topRow();
        Window_ItemBookIndex.lastIndex = this.index();
    };

    function Window_ItemBookStatus() {
        this.initialize.apply(this, arguments);
    }

    Window_ItemBookStatus.prototype = Object.create(Window_Base.prototype);
    Window_ItemBookStatus.prototype.constructor = Window_ItemBookStatus;

    Window_ItemBookStatus.prototype.initialize = function(x, y, width, height) {
        Window_Base.prototype.initialize.call(this, x, y, width, height);
    };

    Window_ItemBookStatus.prototype.setItem = function(item) {
        if (this._item !== item) {
            this._item = item;
            this.refresh();
        }
    };

    Window_ItemBookStatus.prototype.refresh = function() {
        var item = this._item;
        var x = 0;
        var y = 0;
        var lineHeight = this.lineHeight();

        this.contents.clear();

        if (!item || !$gameSystem.isInItemBook(item)) {
            return;
        }

        this.drawItemName(item, x, y);

        x = this.textPadding();
        y = lineHeight + this.textPadding();

        var price = item.price > 0 ? item.price : '-';
        this.changeTextColor(this.systemColor());
        this.drawText(priceText, x, y, 120);
        this.resetTextColor();
        this.drawText(price, x + 120, y, 120, 'right');
        y += lineHeight;

        if (DataManager.isWeapon(item) || DataManager.isArmor(item)) {
            var etype = $dataSystem.equipTypes[item.etypeId];
            this.changeTextColor(this.systemColor());
            this.drawText(equipText, x, y, 120);
            this.resetTextColor();
            this.drawText(etype, x + 120, y, 120, 'right');
            y += lineHeight;

            var type;
            if (DataManager.isWeapon(item)) {
                type = $dataSystem.weaponTypes[item.wtypeId];
            } else {
                type = $dataSystem.armorTypes[item.atypeId];
            }
            this.changeTextColor(this.systemColor());
            this.drawText(typeText, x, y, 120);
            this.resetTextColor();
            this.drawText(type, x + 120, y, 120, 'right');

            x = this.textPadding() + 300;
            y = lineHeight + this.textPadding();
            for (var i = 2; i < 8; i++) {
                this.changeTextColor(this.systemColor());
                this.drawText(TextManager.param(i), x, y, 160);
                this.resetTextColor();
                this.drawText(item.params[i], x + 160, y, 60, 'right');
                y += lineHeight;
            }
        }

        x = 0;
        y = this.textPadding() * 2 + lineHeight * 7;
        this.drawTextEx(item.description, x, y);
    };

})();


code:
//=============================================================================
// By Jorge Blanco (extending YEP_BattleAICore v1.07 by Yanfly Engine Plugins)
// Version 1.00
//=============================================================================
/*:
 * @plugindesc v1.00 Extension for YEP_BattleAICore to support AI on Actors
 * with the Auto-Battle special flag.
 * @author Jorge Blanco (extending YEP_BattleAICore by Yanfly)
 *
 * @help
 * Plug and Play. Place below YEP_BattleAICore.
 * Refer to the original doc of YEP_BattleAICore v1.07 and use the same notes on
 * the (Auto-Battle enabled) Actor's notes field.
 */

var JB = JB || {};
JB.CoreAIAutoBattleActors = JB.CoreAIAutoBattleActors || {};

//=============================================================================
// DataManager
//=============================================================================

JB.CoreAIAutoBattleActors.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
DataManager.isDatabaseLoaded = function() {
  if (!JB.CoreAIAutoBattleActors.DataManager_isDatabaseLoaded.call(this)) return false;
  if (!JB._loaded_YEP_BattleAICoreAutoBattleActors) {
    this.processCoreAINotetags1($dataActors);
    JB._loaded_YEP_BattleAICoreAutoBattleActors = true;
  }
	return true;
};

//=============================================================================
// BattleManager
//=============================================================================
JB.CoreAIAutoBattleActors.BattleManager_updateAIPatterns =
      BattleManager.updateAIPatterns;
BattleManager.updateAIPatterns = function() {
    $gameParty.updateAIPatterns();
	return JB.CoreAIAutoBattleActors.BattleManager_updateAIPatterns(this);
};

//=============================================================================
// Game_Party
//=============================================================================

Game_Party.prototype.updateAIPatterns = function() {
    for (var i = 0; i < this.members().length; ++i) {
      var member = this.members()[i];
      if (member && member.isAlive() && member.isAutoBattle()) member.setAIPattern();
    }
};

//=============================================================================
// Game_Actor
//=============================================================================
Game_Actor.prototype.hasSkill = function(skillId) {
	var skills = AIManager.getPatternSkills(this._skills, this.actor().aiPattern);
    return skills.contains($dataSkills[skillId]);
};

JB.CoreAIAutoBattleActors.Game_Actor_makeAutoBattleActions = Game_Actor.prototype.makeAutoBattleActions;
Game_Actor.prototype.makeAutoBattleActions = function() {
    if (this.actor().aiPattern.length > 0) {
      this.setAIPattern();
      this.setActionState('waiting');
    } else {
      JB.CoreAIAutoBattleActors.Game_Actor_makeAutoBattleActions.call(this);
    }
};

Game_Actor.prototype.setAIPattern = function() {
    Game_Battler.prototype.setAIPattern.call(this);
    if (this.numActions() <= 0) return;
    AIManager.setBattler(this);
    for (var i = 0; i < this.actor().aiPattern.length; ++i) {
	  var random = Math.random();
      if ((random > this.aiLevel()) && (i != this.actor().aiPattern.length - 1)) continue;
      var line = this.actor().aiPattern[i];
      if (AIManager.isDecidedActionAI(line)) return;
    }
    JB.CoreAIAutoBattleActors.Game_Actor_makeAutoBattleActions.call(this);
};

Game_Actor.prototype.aiLevel = function() {
    return this.actor().aiLevel;
};


code:
//=============================================================================
// KMS_AccelerateFileScene.js
//   Last update: 2015/12/05
//=============================================================================

/*:
 * @plugindesc
 * [v0.1.0] Accelerate drawing save/load scene.
 *
 * @author TOMY (Kamesoft)
 *
 * @help This plugin does not provide plugin commands.
 */

/*:ja
 * @plugindesc
 * [v0.1.0] セーブ/ロード画面の描画を高速化します。
 *
 * @author TOMY (Kamesoft)
 *
 * @help このプラグインには、プラグインコマンドはありません。
 */

var KMS = KMS || {};

(function() {

KMS.imported = KMS.imported || {};
KMS.imported['AccelerateFileScene'] = true;

//var pluginParams = PluginManager.parameters('KMS_AccelerateFileScene');
//var Params = {};

//-----------------------------------------------------------------------------
// DataManager

var _KMS_AccelerateFileScene_DataManager_loadGlobalInfo = DataManager.loadGlobalInfo;
DataManager.loadGlobalInfo = function()
{
    if (!this._globalInfoCache)
    {
        this._globalInfoCache = _KMS_AccelerateFileScene_DataManager_loadGlobalInfo.call(this);
    }

    return this._globalInfoCache;
};

var _KMS_AccelerateFileScene_DataManager_saveGlobalInfo = DataManager.saveGlobalInfo;
DataManager.saveGlobalInfo = function(info)
{
    this._globalInfoCache = null;
    _KMS_AccelerateFileScene_DataManager_saveGlobalInfo.call(this, info);
};

})();


code:
//=============================================================================
// KMS_SaveWithSnap.js
//   Last update: 2015/12/04
//=============================================================================

/*:
 * @plugindesc
 * [v0.1.0] Add captured image on save/load scene.
 *
 * @author TOMY (Kamesoft)
 *
 * @param Image scale
 * @default 0.15
 * @desc Scale for snap images.
 *
 * @param Enable JPEG
 * @default 1
 * @desc Uses JPEG format if JPEG size is smaller than PNG size.
 *
 * @help This plugin does not provide plugin commands.
 */

/*:ja
 * @plugindesc
 * [v0.1.0] セーブ/ロード画面にスクリーンショットを追加します。
 *
 * @author TOMY (Kamesoft)
 *
 * @param Image scale
 * @default 0.15
 * @desc セーブ時の画像データのサイズ倍率です。
 *
 * @param Enable JPEG
 * @default 1
 * @desc JPEG 形式が使用可能で、かつ PNG よりサイズが小さくなる場合は JPEG を使用します。
 *
 * @help このプラグインには、プラグインコマンドはありません。
 */

var KMS = KMS || {};

(function() {

KMS.imported = KMS.imported || {};
KMS.imported['SaveWithSnap'] = true;

var pluginParams = PluginManager.parameters('KMS_SaveWithSnap');
var Params = {};
Params.savefileBitmapScale = Number(pluginParams['Image scale'] || 0.15);
Params.enableJpeg = Number(pluginParams['Enable JPEG'] || 1);

//-----------------------------------------------------------------------------
// Bitmap

if (!Bitmap.prototype.save)
{
    /*
     * ビットマップを URL 表現に変換
     */
    Bitmap.prototype.toDataURL = function()
    {
        if (Params.enableJpeg)
        {
            // サイズが小さくなる方を返す
            // ※ サポート外の形式が指定されたら PNG になる仕様なので、
            //    変換結果が null 等になることはない
            var png = this._canvas.toDataURL('image/png');
            var jpeg = this._canvas.toDataURL('image/jpeg');
            return (png.length < jpeg.length) ? png : jpeg;
        }
        else
        {
            return this._canvas.toDataURL('image/png');
        }
    };

}

//-----------------------------------------------------------------------------
// DataManager

var _KMS_SaveWithSnap_DataManager_loadSavefileImages = DataManager.loadSavefileImages;
DataManager.loadSavefileImages = function(info)
{
    _KMS_SaveWithSnap_DataManager_loadSavefileImages.call(this, info);

    if (info.snapUrl)
    {
        ImageManager.loadNormalBitmap(info.snapUrl);
    }
};

var _KMS_SaveWithSnap_DataManager_makeSavefileInfo = DataManager.makeSavefileInfo;
DataManager.makeSavefileInfo = function()
{
    var info = _KMS_SaveWithSnap_DataManager_makeSavefileInfo.call(this);

    var bitmap = this.makeSavefileBitmap();
    if (bitmap)
    {
        info.snapUrl = bitmap.toDataURL();
    }

    return info;
};

/*
 * セーブファイル用のビットマップを作成
 */
DataManager.makeSavefileBitmap = function()
{
    var bitmap = $gameTemp.getSavefileBitmap();
    if (!bitmap)
    {
        return null;
    }

    var scale = Params.savefileBitmapScale;
    var newBitmap = new Bitmap(bitmap.width * scale, bitmap.height * scale);
    newBitmap.blt(bitmap, 0, 0, bitmap.width, bitmap.height, 0, 0, newBitmap.width, newBitmap.height);

    return newBitmap;
};

//-----------------------------------------------------------------------------
// Game_Temp

var _KMS_SaveWithSnap_Game_Temp_initialize = Game_Temp.prototype.initialize;
Game_Temp.prototype.initialize = function()
{
    _KMS_SaveWithSnap_Game_Temp_initialize.call(this);
    this._savefileBitmap = null;
};

Game_Temp.prototype.setSavefileBitmap = function(bitmap)
{
    this._savefileBitmap = bitmap;
};

Game_Temp.prototype.getSavefileBitmap = function()
{
    if (this._savefileBitmap)
    {
        return this._savefileBitmap;
    }
    else
    {
        return SceneManager._backgroundBitmap;
    }
};

//-----------------------------------------------------------------------------
// Window_SavefileList

var _KMS_SaveWithSnap_Window_SavefileList_drawItem = Window_SavefileList.prototype.drawItem;
Window_SavefileList.prototype.drawItem = function(index)
{
    var id = index + 1;
    var info = DataManager.loadSavefileInfo(id);
    if (info)
    {
        var valid = DataManager.isThisGameFile(id);
        var rect = this.itemRectForText(index);
        this.drawSnappedImage(info, rect, valid);
    }

    _KMS_SaveWithSnap_Window_SavefileList_drawItem.call(this, index);

    console.log(KMS.imported['AccelerateFileScene']);
};

/*
 * セーブファイルの画像を表示
 */
Window_SavefileList.prototype.drawSnappedImage = function(info, rect, valid)
{
    if (!(valid && info.snapUrl))
    {
        return;
    }

    var bitmap = ImageManager.loadNormalBitmap(info.snapUrl);
    var dh = this.itemHeight() - 8;
    var dw = bitmap.width * dh / bitmap.height;
    var dx = rect.x + Math.max(rect.width - dw - 120, 0);
    var dy = rect.y + 4;

    this.changePaintOpacity(true);
    this.contents.blt(bitmap, 0, 0, bitmap.width, bitmap.height, dx, dy, dw, dh);
};

})();


code:
/*
#=============================================================================
# Battle Auto Selection
# LeBattleAutoSelection.js
# By Lecode
# Version 1.07
#-----------------------------------------------------------------------------
# TERMS OF USE
#-----------------------------------------------------------------------------
# - Credit required
# - Keep this header
# - Free for commercial use
#=============================================================================
*/
var Imported = Imported || {};
Imported.Lecode_BattleAutoSelection = true;
/*:
 * @plugindesc Skip the selection window when there is only one available enemy or one available ally.
 * @author Lecode
 * @version 1.06
 *
 * @help Skip the selection window when there is only one available enemy
 * or one available ally.
*/
//#=============================================================================

(function() {

/*-------------------------------------------------------------------------
* Scene_Battle
-------------------------------------------------------------------------*/
//---- SelectEnemySelection
var oldSelectEnemySelec_method = Scene_Battle.prototype.selectEnemySelection;
Scene_Battle.prototype.selectEnemySelection = function() {
    oldSelectEnemySelec_method.call(this);
    if ( !this._enemyWindow.active ) { return; }

	let item = BattleManager.inputtingAction().item();
    if (this._enemyWindow._enemies.length == 1 && !item.hasTag(TAG_DONT_AUTO_SELECT_SKILL)) {
    	this._enemyWindow.processOk();
    }

};

//---- SelectActorSelection
var oldSelectActorSelec_method = Scene_Battle.prototype.selectActorSelection;
Scene_Battle.prototype.selectActorSelection = function() {
    oldSelectActorSelec_method.call(this);
    if ( !this._actorWindow.active ) { return; }
	let action = BattleManager.inputtingAction();
    if (action.isForUser() || (action.isForFriend() && action.isForAll())) {
        this._actorWindow.select(BattleManager.actor().index());
        this._actorWindow.processOk();
    } else if (action.isForDeadFriend()) {
		if ($gameParty.deadMembers().length == 1) { this._actorWindow.processOk(); }
	} else {
		if ($gameParty.aliveMembers().length == 1) { this._actorWindow.processOk(); }
	}
};

})();


code:
//
//  限定品 ver1.00
//
// author yana
//

var Imported = Imported || {};
Imported['LimitedOneItem'] = 1.00;

/*:
 * @plugindesc ver1.00/1つしか所持できないアイテムを設定できるようにします。
 * @author Yana
 *
 * @param LimitedKey
 * @desc 限定品を指定するためのメモに記述するキーワードです。
 * @default <限定品>
 *
 * @param KeyItemLimited
 * @desc キーアイテムをすべて限定品として扱う場合、trueに指定してください。
 * @default false
 *
 * @param IncludeMemberEquips
 * @desc パーティメンバーの装備を所持数に含む場合、trueを指定してください。
 * @default true
 *
 * @param IncludeOutMemberEquips
 * @desc パーティ外のメンバーの装備を所持数に含む場合、trueを指定してください。
 * @default true
 *
 * @param ItemFullSwitchID
 * @desc アイテムが所持限界を超えていた場合、ONにするスイッチのIDです。
 * @default 24
 *
 * @param UngettableMessage
 * @desc 所持限界で入手できなかった時ポップアップするテキストです。
 * ※GetInformationの導入が必要です。
 * @default 「\I[_icon]_name」は\c[4]これ以上持てない！
 *
 * @help------------------------------------------------------
 *  プラグインコマンドはありません。
 * ------------------------------------------------------
 * ------------------------------------------------------
 * 設定方法
 * ------------------------------------------------------
 * アイテムや武器、防具のメモ欄に、LimitedKeyで設定したテキストが含まれている場合、
 * そのアイテムは限定品となり、1つ以上持てず、新たに手に入れることができなくなります。
 * また、追加機能として、アイテムの所持限界でそれ以上持てなかった場合、
 * ItemFullSwitchIDで指定したIDのスイッチがONになります。
 * ------------------------------------------------------
 * 利用規約
 * ------------------------------------------------------
 * 使用に制限はありません。商用、アダルト、いずれにも使用できます。
 * 二次配布も制限はしませんが、サポートは行いません。
 * 著作表示は任意です。行わなくても利用できます。
 * 要するに、特に規約はありません。
 * バグ報告や使用方法等のお問合せはネ実ツクールスレ、または、Twitterにお願いします。
 * https://twitter.com/yanatsuki_
 * 素材利用は自己責任でお願いします。
 * ------------------------------------------------------
 * 更新履歴:
 * ver1.00:
 * 公開
 */

(function(){

	var parameters = PluginManager.parameters('LimitedOneItem');
	var limitedKey = RegExp(parameters['LimitedKey'] || '<限定品>');
	var keyItemLimited = String(parameters['KeyItemLimited']) === 'true';
	var includeMemberEquips = String(parameters['IncludeMemberEquips']) === 'true';
	var includeOutMemberEquips = String(parameters['IncludeOutMemberEquips']) === 'true';

	var itemFullSwitchId = Number(parameters['ItemFullSwitchID']) || 24;

	var ungettableMessage = String(parameters['UngettableMessage'] || '「\\I[_icon]_name」は\\c[4]これ以上持てない！');

	DataManager.isLimitedOne = function(item) {
		if (!item){ return false }
		if (item._limitedOne === undefined) {
			if (keyItemLimited && item.itypeId === 2){
				item._limitedOne = true;
			} else {
				item._limitedOne = !!item.note.match(limitedKey);
			}
		}
		return item._limitedOne;
	};

	Game_Party.prototype.isOnlyOne = function(item) {
		var limitedOne = DataManager.isLimitedOne(item);
		if (!limitedOne){ return false }
		if (!includeMemberEquips){ return false }
		for(var i=0;i<$dataActors.length;i++){
			var actor = $dataActors[i];
			if (!!actor){
				var aa = $gameActors.actor(actor.id);
				if (includeOutMemberEquips || this.members().contains(aa)){
					if (!!aa && aa.equips().contains(item)){ return true }
				}
			}
		}
		return false;
	};

	var _LOI_GParty_maxItems = Game_Party.prototype.maxItems;
	Game_Party.prototype.maxItems = function(item) {
		if (DataManager.isLimitedOne(item)){ return 1 }
		return _LOI_GParty_maxItems.call(this,item);
	};

	var _LOI_GParty_gainItem = Game_Party.prototype.gainItem;
	Game_Party.prototype.gainItem = function(item, amount, includeEquip) {
		var n = this.numItems(item);
		var flag = (n+amount)>this.maxItems(item)
		$gameSwitches.setValue(itemFullSwitchId,flag);
		if (flag){
			if (Imported['GetInformation']) {
				console.log(ungettableMessage)
				if (ungettableMessage !== ''){
					CommonPopupManager.showInfo(item, ungettableMessage);
				}
			}
			return;
		}
		_LOI_GParty_gainItem.call(this, item, amount, includeEquip);
	};

	var _LOI_GParty_hasMaxItems = Game_Party.prototype.hasMaxItems;
	Game_Party.prototype.hasMaxItems = function(item) {
		var result = _LOI_GParty_hasMaxItems.call(this,item);
		return result || this.isOnlyOne(item);
	};
}());