How to Reset the Counter

Please explain what you are trying to accomplish. Why do you want/need a counter ? When does it need to count ? When the object is lower than 5000 ?