Requesting some help with a skill cost script

Hi, first post on the forum, I'm sorry it comes off as one of those whiny help me threads, but I'm a little bit stumped.

I 'borrowed' a script from @mrcopra last night, to get some skills costing gold (thanks!) but I've run into a little issue with it and I don't know enough about javascript to fix it. The gold is displaying next to the skill and is deducting from the total amount just fine, but it's also subtracting from the TP value which I don't want it to do.

Could a coding wizard have a quick look through and tell me what needs to change? I will forever adore you, honest.

Spoiler: Code
Code:
/*:
 * @plugindesc Make skill cost gold. V 1.2
 * Read Help
 * @author mrcopra
 *
 *
 * @param CostGoldColour
 * @desc Change The cost colour
 * @default 17
 *
 * @help Write this in skill's note
 * <costGold:x>     // x is the amount of gold
 */

  var parameters = PluginManager.parameters('SkillCostGold');
   var CostGoldColour = Number(parameters['CostGoldColour'] || 17);
 
Game_BattlerBase.prototype.canPaySkillCost = function(skill) {
    //console.log(Number(skill.meta.costGold))
    if (skill.meta.costGold){
    return $gameParty.gold() >= this.skillGdCost(skill)}else{
    return this._tp >= this.skillTpCost(skill) && this._mp >= this.skillMpCost(skill)};
};

Window_Base.prototype.gdCostColor = function() {
    return this.textColor(CostGoldColour);
};

Window_SkillList.prototype.drawSkillCost = function(skill, x, y, width) {
    if (this._actor.skillGdCost(skill) > 0) {
        this.changeTextColor(this.gdCostColor());
        this.drawText(this._actor.skillGdCost(skill), x, y, width, 'right');
    } else if (this._actor.skillTpCost(skill) > 0) {
        this.changeTextColor(this.tpCostColor());
        this.drawText(this._actor.skillTpCost(skill), x, y, width, 'right');
    } else if (this._actor.skillMpCost(skill) > 0) {
        this.changeTextColor(this.mpCostColor());
        this.drawText(this._actor.skillMpCost(skill), x, y, width, 'right');
    }
};

Game_BattlerBase.prototype.skillMpCost = function(skill) {
    if (skill.meta.costGold){
        return Number(skill.meta.costGold);
    }
    return Math.floor(skill.mpCost * this.mcr);
};

Game_BattlerBase.prototype.skillTpCost = function(skill) {
        if (skill.meta.costGold){
        return Number(skill.meta.costGold);
    }else{
    return skill.tpCost};
};

Game_BattlerBase.prototype.skillGdCost = function(skill) {
    return Number(skill.meta.costGold);
};

Game_BattlerBase.prototype.paySkillCost = function(skill) {
    this._mp -= this.skillMpCost(skill);
    this._tp -= this.skillTpCost(skill);
    if (skill.meta.costGold){
    console.log(this.skillGdCost(skill));
$gameParty.loseGold(this.skillGdCost(skill))} ;
};

Game_BattlerBase.prototype.meetsSkillConditions = function(skill) {
    return (this.meetsUsableItemConditions(skill) &&
            this.isSkillWtypeOk(skill) && this.canPaySkillCost(skill) &&
            !this.isSkillSealed(skill.id) && !this.isSkillTypeSealed(skill.stypeId));
};
Before moving this to JS Plugin Support, just one quick question.

Normally skills do not use TP unless you tell it to by giving it a TP cost on the skill tab. Have you checked that the TP for this particular skill is set to zero?
Oh, did I put it in the wrong place? Sorry about that.

Yeah, checked that over. I did a quick test by changing the gold cost from 50 to something silly (30000) in the notes box on the skill. Sure enough, when I used the skill, the TP went to -29,990 for a moment before setting back to 0.

A quick link to show you the skill: http://i.imgur.com/PB8RwOi.png
I'm no expert (*snicker*) but I think it might be something to do with this:

Code:
Game_BattlerBase.prototype.skillTpCost = function(skill) {
        if (skill.meta.costGold){
        return Number(skill.meta.costGold);
    }else{
    return skill.tpCost};
};

"If the skill costs gold, then its TP cost should be its gold cost". Does that look right to you? 😉
O- oh. Right, that doesn't look right at all. Hah. What would I need to do to put that right?

Edit: I just commented it out. It was that easy?! Thank you very much, @Trihan. As promised, I adore you forever.
Moved to: Plugin Support
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/requesting-some-help-with-a-skill-cost-script.75892/