Referencing (Yanfly) Cooldowns as a Skill Cost (+ State-Affected CD's)?

Spoiler: Yanfly Plugins Being Used for this Specifically:
-Skill Core
-Skill Cooldowns
-Auto-Passive States (and Buff & States Core)
-Skill Learn System
-Enhanced TP (to control TP at a set number)

Note: Also, one can assume that I have access to all Yanfly.moe hosted plugins, though not all are being used for my project at present.

What I'm trying to do:

An easy way for me to 'pre-display' the CD on a skill (before it is actually used) would be to just use a 'TP Cost' value (since my game isn't actually using a TP system or gauge. It's only used as a substitute 'reference' in place of the Cooldown Time). Now, so far, this works fine until I add in a Passive State that reduces that Cooldown. Obviously, the cooldown time is correctly adjusted by having the passive state enabled, but the displayed CD remains the same because it is actually the TP Cost.

So... my theory on an "easy" fix would be to just find a way for that passive to reduce TP Cost by the same number. However, there doesn't seem to be a 'TP Cost' notetag for Auto-Passive states (none that I can find). Another way I attempted was trying a <Custom TP Cost> notetag for a skill by feeding it an "If, Then".

Ex.
<Custom TP Cost>
if user.isStateAffected(x) {

cost -= 1}

</Custom TP Cost>

Naturally, there either A) isn't a way to do this... or (more likely), I'm not going about this correctly. And it feels like I've tried this a dozen different ways and yet, probably missing something obvious. So if there is a way, would one happen to have any suggestions on what to try? Either within the plugins themselves or other ways?

The gist of what I am trying to do is accurately display Cooldown times before use (or technically TP Cost, in this case). 😉

I thank you for your time. 🙂

~TC
lol, you just forgot the brackets

<Custom TP Cost>
if (user.isStateAffected(x)) {

cost -= 1}

</Custom TP Cost>

Smart idea by the way, though l don't think I'll ever not use TP in my games, it's just too useful.
Hahaha. Drat. I figured it was some simple mistake that I was overlooking. I gave it a try and predictably that worked. I appreciate it. Even if it was something that should have been obvious to me. XD

Issue resolved... My thanks! XD

Or... if anyone thinks of any easier ways to do this then I'm open to that. But, I'm just glad that this works as intended now. Even if I have to go through each skill and plug this in each notetag. I can live with it for now. 🙂
99% of the problems you'll ever have with Javascript will be caused by forgetting brackets around a condition, putting in an extra semicolon, or forgetting a semicolon.

Original thread: https://forums.rpgmakerweb.com/threads/referencing-yanfly-cooldowns-as-a-skill-cost-state-affected-cds.75206/