Skill Message Plugin

I want a move to say "(character) tried to eat (target)!" (character is a snake) so, I need a plugin that makes %2 display the target's name. I know it's possible because I found an old post that gave a code for exactly that, (link) but I think it was either too old to be compatible with updates or I did something wrong trying to convert the code to plugin form. I'd try to fix the problem myself, but I understand nothing about how plugins work, so I'd probably end up corrupting my whole computer somehow. I am using YEP_BattleEngineCore, btw.
Um... Bump?
I wrote this almost a year ago that does exactly this.
If I remember correctly if there are too many targets then it goes out of screen tho.

Code:
//=============================================================================
// MRP_BattleLogSkillTarget.js
//=============================================================================
/*:
 * @plugindesc Skills can now display target names using %2
 * @author Magnus0808
 */
 
(function() {
   
    Window_BattleLog.prototype.displayAction = function(subject, item) {
        var numMethods = this._methods.length;
        var targets = BattleManager._targets;
       
        if (DataManager.isSkill(item)) {
            var targets_string = "";
            // Checks if there is a target
            if (targets && targets.length > 0) {
                targets_string += targets[0].name();
                // Checks if there is more than a single target
                if (targets.length > 1) {
                    for (var i = 1; i < targets.length-1; i++) {
                        targets_string += ", " + targets[i].name();
                    }
                    targets_string += " and " + targets[targets.length-1].name();
                }
            }
            if (item.message1) {
                this.push('addText', subject.name() + item.message1.format(item.name, targets_string));
            }
            if (item.message2) {
                this.push('addText', item.message2.format(item.name, targets_string));
            }
        } else {
            this.push('addText', TextManager.useItem.format(subject.name(), item.name));
        }
        if (this._methods.length === numMethods) {
            this.push('wait');
        }
    };
})();
I wrote this almost a year ago that does exactly this.
If I remember correctly if there are too many targets then it goes out of screen tho.
Code:
//=============================================================================
// SkillMessage.js
//=============================================================================
/*:
 * @plugindesc Skills can now display target names using %2
 * @author Magnus0808
 */
 
(function() {
   
    Window_BattleLog.prototype.startAction = function(subject, action, targets) {
        var item = action.item();
        this.push('performActionStart', subject, action);
        this.push('waitForMovement');
        this.push('performAction', subject, action);
        this.push('showAnimation', subject, targets.clone(), item.animationId);
        this.displayAction(subject, item, targets);
    };
   
    Window_BattleLog.prototype.displayAction = function(subject, item, targets) {
        var numMethods = this._methods.length;
           
        if (DataManager.isSkill(item)) {
            var targets_string = "";
            // Checks if there is a target
            if (targets && targets.length > 0) {
                targets_string += targets[0].name();
                // Checks if there is more than a single target
                if (targets.length > 1) {
                    for (var i = 1; i < targets.length-1; i++) {
                        targets_string += ", " + targets[i].name();
                    }
                    targets_string += " and " + targets[targets.length-1].name();
                }
            }
            if (item.message1) {
                this.push('addText', subject.name() + item.message1.format(item.name, targets_string));
            }
            if (item.message2) {
                this.push('addText', item.message2.format(item.name, targets_string));
            }
        } else {
            this.push('addText', TextManager.useItem.format(subject.name(), item.name));
        }
        if (this._methods.length === numMethods) {
            this.push('wait');
        }
    };
})();

Tried it, but it doesn't show the target's name, it just doesn't put anything there. Here's a screenshot of my active plugins, if that helps.
Spoiler: Plugins
Your plugin is highlighted.
Plugins.png
I should have checked if it worked with YEP_BattleEngineCore first. I changed it a bit and it should work now. It should be placed above YEP_BattleEngineCore.

I have edited my original reply 🙂
I should have checked if it worked with YEP_BattleEngineCore first. I changed it a bit and it should work now. It should be placed above YEP_BattleEngineCore.

I have edited my original reply 🙂
It works now. Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/skill-message-plugin.106916/