So, first of all, editing the core library JS files directly is not a good practice. These files need to remain pristine. If you accidentally make a mistake editing these, then your only option to fix the problem would be start deleting all your custom changes until things start working again.
The recommended way to do this is to create a plugin that
redefines or
extends the functionality of a given function.
Here's the basic, minimal structure of a plugin for MZ:
JavaScript:
/*:
* @target MZ
* @plugindesc [INSERT PLUGIN NAME HERE]
* @author [INSERT YOUR NAME HERE]
* @url [INSERT YOUR WEBSITE HERE]
* @help
* [INSERT TEXT DESCRIPTION OF YOUR PLUGIN HERE]
*/
(function() {
'use strict';
//[INSERT CODE HERE]
})();
By doing it this way, if things go sideways, you can turn off your plugin in the editor and the code in core JS library will be
guaranteed to work correctly.
That said, if you ever need an example of how something works, doing a
search on the core libraries is a good way to learn stuff.
I recommend taking your custom modifications to
Window_SavefileList.prototype.drawItem and putting them in a plugin.
Now, next issue. Dropping a string in the if statement is valid Javascript, but it won't have any effect on the game's behavior. Do you want to have the character's name appear as text? We're in a Window class, so the function for that is
this.drawText(text, x, y, width, alignment) (
reference).
Also, I recommend moving this code into the
if (info) block. That block is essentially guarding against the case that this function gets called with null or undefined save file info, in which case, trying to use any of its data would cause a crash.