It would help us help you if you explained
where you're trying to do this.
As coyote points out, there's an event command to obtain that. If the timing of where you need the information doesn't work for running an event, then the method you're looking for is
userId()
If that's in the damage formula, then
a.userId() will work, so long as no enemies use that skill.
If it's someplace else, then it depends on the plugin you're using to execute the code.
I can't speak to what you looked at, but when I Google "rpg maker mz script call user id" the top results are several threads here with the correct answer.
It also produces the MZ Script Call list, which will have the correct syntax as well.
This Script Call list applies to both RPG Maker MV and RPG Maker MZ. Link here to see the entire list. Supplementary Material for RPG Maker MZ: https://forums.rpgmakerweb.com/index.php?threads/rpg-maker-mz-script-call-reference.122501/ Have fun eventing~
forums.rpgmakerweb.com
Good luck!