Thanks for the suggestions however I've faced some awkward issue.
I've prepared an illustration for the better understanding of the problem.
When ever I press the attack button on the bottom left, it deducts from stamina 2 points, then there should be a timer that starts counting 2 minutes after which there will be refilled one point and make it 99/100.
This is where the issue occurs, whenever I try to take the current time using the Browser, I take the time when this action was made, add to it the 2 minutes in milliseconds, and perform another event check if this value is < than the current time, then there should be an increase of stamina by 1.
Following this method, if i'll have for example 67/100 points, i won't be able to see 68/100, 69/100, ..., n/100 it will simply jump to 100/100 once the total time has passed. Moreover, considering this in cases when the user logs out, and returns, some time has passed so he must have the corresponding filled points.
The issue in two words, how to make it add 1 point every X seconds even when the user is offline. The solution i have in mind is making an array with the time stamps for each point. Which is a very strange and awkward attempt to resolve this task.