How do I apply this script to a player?

Good day!
I once used this script to dim some characters:
SceneManager._scene._spriteset._characterSprites[1].tint = 0x000000
But now, I'd like to change the player's tint a bit, but I can't apply it, is there any way to change the script a bit to make it work?
Seems to me the player's sprite is the last one that gets added to the character sprites. So maybe the following works?
JavaScript:
SceneManager._scene._spriteset._characterSprites[SceneManager._scene._spriteset._characterSprites.length-1].tint = 0x000000

eomereolsson​

Perfectly works! Thank you! ^^

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-apply-this-script-to-a-player.150959/