I know there is a /mentorlevel command to do that in chat, how can I do it in LUA code?

My function checks the level of the target, adds 7 to that and I want to use that value to set the mentor level.