MV Loading a certain file based on id and/or property in a plugin's code

Good day, I'm trying to implement code to load a filename (.PNG file to be exact) that possesses an ID and/or property. In my case: I created a folder called "fossils" in the graphics directory (img) and I want to assign fossils based on the species of Saurian ID (which is stored via the Classes section of the Database) and an initial character representing the part of that creature's skeleton.

Below are the initials I'll be using and their meaning:

H = Head
B = Body
A = Arms
L = Legs
T = Tail
F = Full Body

This is an example of how I set up an image's name: 001_H.png

Also can anyone tell me what could make a good method for implementing the prefix 'FR_' (which is short for Fossil Rock) to a file
Thank you in advance.
All you need for that is string operations.
the load function expects the filename to be given as a string or a string variable, and you can simply add the string together from the parts you want it to have, example:
Code:
temp = 'img/'+temp2+'L'+'00';
OK. Thanks!
Somehow it is telling me that the class ID is undefined in my Spriteset_Cleaning.damageName function. It is being returned as: 'd_undefinedH.png'

JavaScript:
function Spriteset_Cleaning() {
    this.initialize.apply(this, arguments);
    this._damageLocated = false;
}


Spriteset_Cleaning.prototype = Object.create(Spriteset_Base.prototype);
Spriteset_Cleaning.prototype.constructor = Spriteset_Cleaning;


Spriteset_Cleaning.prototype.initialize = function() {
    Spriteset_Base.prototype.initialize.call(this);
};


Spriteset_Cleaning.prototype.createLowerLayer = function() {
    Spriteset_Base.prototype.createLowerLayer.call(this);
    this.createDamage();
};


Spriteset_Cleaning.prototype.createDamage = function() {
    this._damage = new TilingSprite();
    this._damage.move(0, 0, Graphics.width, Graphics.height);
    this._damage.bitmap = this.damageBitmap();
    this._cleaningBG.addChild(this._damage);
};


Spriteset_Cleaning.prototype.damageBitmap = function() {
    return ImageManager.loadDamage(this.damageName());
};


ImageManager.loadDamage = function(filename, hue) {
    return this.loadBitmap('img/damage/', filename, hue, true);
};


 var GT_Cleaning_Game_Item_initMembers = Game_Item.prototype.initMembers;
Game_Item.prototype.initMembers = function(){
    this._classId = 0;
    GT_Cleaning_GameItem_initMembers.call(this);
};


  Game_Item.prototype.changeClass = function(classId) {
    this._classId = classId;
    this.refresh();
  };


Spriteset_Cleaning.prototype.damageName = function(itemId, fossilType) {
    itemId = $dataClasses[this._classId];
    fossilType = getPartID();
    return 'd_' + itemId + fossilType;
};


Spriteset_Cleaning.prototype.updateDamage = function() {
    if (!this._damageLocated) {
        this.locateDamage();
        this._damageLocated = true;
    }
};


Spriteset_Cleaning.prototype.locateDamage = function() {
    var width = this._cleaningBG.width;
    var height = this._cleaningBG.height;
    var dmgSprite = this._damage;
    dmgSprite.origin.x = dmgSprite.x + (dmgSprite.bitmap.width - width) / 2;
};
'd_' + itemId + fossilType;
itemID is most likely a number, not a string.
the + opertor is both a mathematical and a string operator, but it can't add numbers to strings, only add the same type of data.
there should be a function to convert numbers to strings, that needs to be used in combination with the itemid
sorry, I don't know enough about javascript to tell you how that function is named, but you should be able to find it in any javascript description.

Original thread: https://forums.rpgmakerweb.com/threads/loading-a-certain-file-based-on-id-and-or-property-in-a-plugins-code.133544/