Gold Drop Multiplier?

I've got a skill in my game that's meant to make grinding for money a bit easier on the player by forcing enemies to drop more gold. However, the current system only allows for a 2.0x multiplier on the amount of gold dropped, while I'm looking for something a bit more reasonable (1.5x, I'm thinking). Are there any scripts out there that can change the multiplier?
Try this ...


//======================================================================
// GoldDropMultiplier.js
//======================================================================

/*:
* @plugindesc Changes multiply rate of gold from the default 2x
<GoldDropMultiplier>
* @author Shaz
*
* @param Multiply Rate
* @desc Use this rate when the 'double gold' feature is present
* @default 1.5
*
* @param Multiply Variable
* @desc Variable ID that contains multiply rate
* @default 0
*
* @help This plugin has no plugin commands
*
* Use the Multiply Rate OR the Multiply Variable, not both. If the variable
* is specified, it will be used and the rate will be ignored. Using a
* variable allows more flexibility as you can change the multiply rate
* during the game and not be fixed to a single rate the entire time.
*/

(function() {
var parameters = $plugins.filter(function(p) { return p.description.contains('<GoldDropMultiplier>'); })[0].parameters;
var multRate = Number(parameters['Multiply Rate'] || 1.5);
var multVar = Number(parameters['Multiply Variable'] || 0);

var _Game_Troop_goldTotal = Game_Troop.prototype.goldTotal;
Game_Troop.prototype.goldTotal = function() {
return Math.floor(_Game_Troop_goldTotal.call(this));
};

Game_Troop.prototype.goldRate = function() {
if ($gameParty.hasGoldDouble()) {
return multVar > 0 ? $gameVariables.value(multVar) : multRate;
} else {
return 1;
}
};
})();





Note - I haven't tested this.  If you get any errors, please open the developer tools (F8) and take a screenshot of the Console tab.
Or maybe this.
@Shaz I tested it a bit, and it seems to work fine so far. Thank you very much!


@Alistair I didn't actually see your script until after I'd already started working with Shaz's, but it definitely seems very useful. Probably not what I need right now (since I don't think there will be more than one way to increase the amount of gold earned from fights), but if I do, I'll be sure to give it a look. Thank you!
Great contribution -- was going to look for something like this! Shaz is the best!

Original thread: https://forums.rpgmakerweb.com/threads/gold-drop-multiplier.74253/