Timeline variable keys

Can I set a key in a timeline to a variable, I’m trying to create a dynamic timeline with the second key always ending at one second with the value of 0, but I want the first key to be a certain variable(basically editable), is this possible? I just can’t find anything, I wish it was as easy as using “set” like on any other number holding variable.