MV Referencing Skill in Specific YEP_SkillCore Notetags

I'm trying to get the Skill ID in a Notetag.
The Skill in question being the skill that contains the Notetag.

To be more precise, I am specifically talking about the
<Custom Requirement> AND <Cost Display Eval> / <Custom Cost Display>

#1 I know that for other notetags such as <After Eval>, "this.item()" can be used to reference the skill.
#2 I found out that for notetags such as <Custom MP Cost>, "skill" can be used to reference the skill.

But neither of these work for the above mentioned notetags
("skill" throwing an error (undefined) and "this.item()" returning "null")

Am I overlooking something else to try, or is there no way of getting the skill in these notetags?
Link for convenience:
Looks like a local variable named item is available for all 11 of the eval tags ("Lunatic Mode") in YEP Skill Core, so I think stuff like this ought to work:

<Custom Requirement> // The switch with ID equal to the skill ID must be ON value = $gameSwitches.value(item.id); </Custom Requirement>
Unfortunately, for the 2 tags you've specified skill should also work (same value as item), so I'm not sure what's going wrong. 😅
Spoiler: supporting skill core excerpts
<Custom Requirements>
JavaScript:
Game_BattlerBase.prototype.meetsSkillConditionsEval = function(skill) {
    if (skill.requireEval === '') return true;
    var value = true;
    var item = skill;
    var a = this;
    var user = this;
    var subject = this;
    var s = $gameSwitches._data;
    var v = $gameVariables._data;
    var code = skill.requireEval;
    try {
      eval(code);
    } catch (e) {
      Yanfly.Util.displayError(e, code, 'SKILL CUSTOM REQUIRE EVAL ERROR');
    }
    return value;
};
<Cost Display Eval>
JavaScript:
Window_SkillList.prototype.runDisplayEvalCost = function(skill) {
    if (skill.costdisplayEval === '') return;
    var item = skill;
    var a = this._actor;
    var user = this._actor;
    var subject = this._actor;
    var s = $gameSwitches._data;
    var v = $gameVariables._data;
    var code = skill.costdisplayEval;
    try {
      eval(code);
    } catch (e) {
      Yanfly.Util.displayError(e, code, 'SKILL COST DISPLAY EVAL ERROR');
    }
};

PS: this.item() is for an action context, but cost-/requirement-related tags are evaluated before the action is determined. The action tags generally define var item = this.item() as a shortcut.

(This sort of thing depends entirely on what variables the plugin makes available when evaluating the notetag, so the notetag/plugin is very important here. Luckily YEP Skill Core is free and not obfuscated, so it's easy for someone familiar with JS to check the plugin's code. 😮‍💨)
@caethyril

Thank you so much for your help!

The hint that both "item" and "skill" /should/ have worked gave me enough of a lead to figure out what went wrong.



It turns out that the culprit was actually the plugin VE_EscapeCodes.
That plugin offers a new escape code for texts called \e[' '], which allows you to
perform an eval within and return the resulting value.

So what I did until now was this:

<Custom Cost Display>
\e['skillNotetag(skill.id, 2)']
</Custom Cost Display>

I did it like that so that I wouldn't need to put up an extra <Cost Display Eval> before that to determine the Display.



But it appears that this escape code cannot retrieve the data for "skill".
With your help I managed to circumvent the Problem very easily:

<Cost Display Eval>
$gameVariables.setValue(401, skillNotetag(item.id, 2));
</Cost Display Eval>

<Custom Cost Display>
\V[401]
</Custom Cost Display>

I may be required to use the <Cost Display Eval> now, but who cares. The Notetag may look a little more bloated now, but atleast I am using the notetags as intended now.

Thank you again for your help and your time, @caethyril !
😂 😂
Ah, I see: <Custom Cost Display> is not an eval tag, that's why it wasn't working. After all, if it was an eval tag, you could skip the text code part completely. I'm not sure why it's listed in the Lunatic Mode section, probably an oversight.

Good to see you got it working, happy RPG Making! 😂

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/referencing-skill-in-specific-yep_skillcore-notetags.146862/