No idea how your plugin is written so I can't really help you with that. If you're using the tab endpoint then you'd just send the users id with the ajax URL or grab the displayed user id using API. The endpoint function is getTabComponent, which is called when a below example URL is used.
index.php?option=com_comprofiler&view=tabclass&tab=TAB_CLASS_NAME&format=raw
At the time of initializing the ajax (if from PHP) you can add the displayed user id to the URL and just grab it in your PHP as needed. Example as follows.
index.php?option=com_comprofiler&view=tabclass&tab=TAB_CLASS_NAME&user=USER_ID_HERE&format=raw
The user object sent to getTabComponent is always the viewing user object, but you can get the displayed users user id with the following API call.
Code:
$userId = $_CB_framework->displayedUser();