How to go about making a time-based key GUI?

If the title is a bit confusing, sorry. Did not know how to exactly word it but could someone point me in the right direction of making something like this?

image

Basically if you hit the thing within the area, you will dodge.

I assume the yellow line moves back and forth and it counts wherever it is when you click block towards your accuracy. The component parts are not that complex. Could you try making just the bar and moving yellow line part?