I have tested the version below with YEP_X_ActSeqPack2, and it seems to work. Feel free to try it with your application.
Code:
// AdjustStatePositions.js
// Created on 9/18/2018
// Last modified on 10/22/2018 by Yethwhinger
var objYeth = objYeth || {};
/*:
* @plugindesc This plugin is meant to adjust the positions of the
* state displays over battlers.
* @author Yethwhinger
*
* @help This plugin adjusts the position of the state icon or
* overlay over a battler by moving it using <stateX:number1>
* and <stateY:number2> entries in the note fields of the Enemies
* and Actors sections of the database. number1 and number2
* represent pixel adjustments in the x and y directions.
*/
//----------------------------
// Changes to Game_Enemy
//----------------------------
objYeth.Game_Enemy_setup = Game_Enemy.prototype.setup;
Game_Enemy.prototype.setup = function (enemyId, x, y) {
var tempX = $dataEnemies[enemyId].meta.stateX;
var tempY = $dataEnemies[enemyId].meta.stateY;
objYeth.Game_Enemy_setup.call(this, enemyId, x, y);
this._stateX = 0;
this._stateY = 0;
if (tempX) {
this._stateX = Number(tempX);
}
if (tempY) {
this._stateY = Number(tempY);
}
};
//----------------------------
// Changes to Game_Actor
//----------------------------
objYeth.Game_Actor_setup = Game_Actor.prototype.setup;
Game_Actor.prototype.setup = function (actorId) {
var tempX = $dataActors[actorId].meta.stateX;
var tempY = $dataActors[actorId].meta.stateY;
objYeth.Game_Actor_setup.call(this, actorId);
this._stateX = 0;
this._stateY = 0;
if (tempX) {
this._stateX = Number(tempX);
}
if (tempY) {
this._stateY = Number(tempY);
}
};
//----------------------------
// Changes to Sprite_StateIcon
//----------------------------
objYeth.Sprite_StateIcon_setup = Sprite_StateIcon.prototype.setup;
Sprite_StateIcon.prototype.setup = function (battler) {
objYeth.Sprite_StateIcon_setup.call(this, battler);
this.x = battler._stateX;
if (battler.isActor()) {
this.y = battler._stateY;
}
};
//----------------------------
// Changes to Sprite_StateOverlay
//----------------------------
objYeth.Sprite_StateOverlay_setup = Sprite_StateOverlay.prototype.setup;
Sprite_StateOverlay.prototype.setup = function (battler) {
objYeth.Sprite_StateOverlay_setup.call(this, battler);
this.x = battler._stateX;
this.y = battler._stateY;
};
//----------------------------
// Changes to Sprite_Battler
//----------------------------
objYeth.Sprite_Battler_updateStateSpritesAdjPos = Sprite_Battler.prototype.updateStateSprites;
Sprite_Battler.prototype.updateStateSprites = function () {
var stateY = this._battler._stateY;
objYeth.Sprite_Battler_updateStateSpritesAdjPos.call(this);
if (this._stateIconSprite) {
this._stateIconSprite.y += stateY;
}
if (this._stateSprite) {
this._stateSprite.y += stateY;
}
};
//----------------------------
// Changes to Sprite_Enemy
//----------------------------
Sprite_Enemy.prototype.updateStateSprite = function () {
this._stateIconSprite.y = -Math.round((this.bitmap.height + 40) * 0.9) + this._battler._stateY;
if (this._stateIconSprite.y < 20 - this.y) {
this._stateIconSprite.y = 20 - this.y;
}
};