onready var bar = $progessbar
var progress = 0
var cooldown = false
var bar_speed = 2.5
func _process(delta):
bar.value = progress
if cooldown:
progress -= bar_speed
if progress <= 0:
cooldown = false
func on_area_enterd(body):
cooldown = true
progress = 100 # or max value
2.5 bar speed is 1 second so if you have a timer of 5 secs do 2.5*5 so bar speed will be 12.5