Store a given character's TP in a variable?

What the title says. It doesn't seem to be a native function (or else, I've missed it...)
Is there a script or plugin call that can do that?
$gameActors.actor(X).tp
Replace X with the ID number of the actor in your database.

To put this into a variable, you can use the normal 'control variables' command and then tick the script box and paste the above script into it. Alternatively, you could use the 'Script...' command to write to a variable directly via the below script, replacing Y with the variable number and X with the actor ID:

$gameVariables.setValue(Y, $gameActors.actor(X).tp)
Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/store-a-given-characters-tp-in-a-variable.120963/