Try to start and stop the project. There are 2 states of variable "Project is running": "Yes" - the project is running "No" - the project is stopped
When you stop the project, there is an event "Project was stopped". You can use this logic, but with a credit.