Every time the user's health is observed or modified, update the health and the timestamp before returning the results of the observation or applying the modification.
To prevent possible issues caused by the server’s time being reset, don’t store the health timestamp in the save file. Instead, during saving, update the health using the timestamp, and then save just the health. Set the timestamp again at load.
Store the user’s health and a timestamp.
Every time the user's health is observed or modified, update the health and the timestamp before returning the results of the observation or applying the modification.
To prevent possible issues caused by the server’s time being reset, don’t store the health timestamp in the save file. Instead, during saving, update the health using the timestamp, and then save just the health. Set the timestamp again at load.