Creating methods for core objects

You cant add a function to a class (sadly) so you will have to create your own class system using OOP (or Object Oriented Porgramming), and have it remain constant until the player leaves the game.
So when loading in the data of the player, store it somewhere you can reference, then use said function to check if they have said value in their data.

If you’re interested in learning more about OOP, I recommend these sources:

OOP Forum Post
OOP Video by GnomeCode
Roblox Documentation on Metatables (Covers OOP related items)