batch file need modification Windows

Job ID: 35790713

Budget: $10 – $30 USD

Hello
I have this bat file which keeps running in loop. each app has its countdown to close
The bat works fine but the problem is if I open one app and then close the app manually its timer will not stop which might affect the second app as its timer will not start when I open it

@echo off
title App_Timer
setlocal EnableDelayedExpansion
:2
Color 0A
echo Game Timer ready.....
:1
Set "Processes=mspaint.exe Notepad.exe"
for %%a in (%Processes%) Do (
for /f %%b in ('tasklist /NH /FI "imagename eq %%a"') Do (
if [%%b]==[%%a] (
Color 0A
if %%a==mspaint.exe (set var=5 )else if %%a==Notepad.exe ( set var=15 )
echo %%b is running countdown starting.....
Color 06
timeout /t !var! /nobreak
echo %%b is now over
Taskkill /f /im "%%b" > nul 2>&1

GOTO :2
)
)
)
GOTO :1