FlatMMO Stop Wasting Potions

Block potion usage if it will waste it

// ==UserScript==
// @name         FlatMMO Stop Wasting Potions
// @namespace    com.dounford.flatmmo.swp
// @version      0.0.1
// @description  Block potion usage if it will waste it
// @author       Dounford
// @license      MIT
// @match        *://flatmmo.com/play.php*
// @grant        none
// @require      https://update.greasyfork.org/scripts/544062/FlatMMOPlus.js
// ==/UserScript==
 
(function() {
    'use strict';
 
    class stopWastePotionsPlugin extends FlatMMOPlusPlugin {
        constructor() {
            super("Stop Waste Potions", {
                about: {
                    name: GM_info.script.name,
                    version: GM_info.script.version,
                    author: GM_info.script.author,
                    description: GM_info.script.description
                },
                config: []
            });
        }
     
        onLogin() {
            const originalClick = window.clicks_inventory_item;
			window.clicks_inventory_item = function(ele, item, current_amount, index) {
				if(item.includes("potion") && potions_active[item]) {return}
				originalClick(ele, item, current_amount, index)
			}
        }
    }
 
    const plugin = new stopWastePotionsPlugin();
    FlatMMOPlus.registerPlugin(plugin);
 
})();