Hi,
It's normal that the user_id of the hikashop_user table doesn't match necessarily the user_cms_id of the same table (which correspond to the id of the users table of Joomla).
A user in the hikashop_user will be created for guest users but they won't have an entry in the users table since they won't have a Joomla user account, and thus the user_cms_id will be 0 for that entry.
And if the next user creates a user account, his user_cms_id will then be 1 less than the user_id.
If you don't allow for guest checkout, and if you have the users and the hikashop_user tables synchronized (with MySQL queries to update the ids) it should lead to the user_id being always equal to the user_cms_id.
But I think that the best would be to fix the custom plugin you have so that it can use the correct ids.