Hi Kris,
as Vivek suggests: to get a quality answer it's very helpful to explain the context. more often than not with these type of questions the trainee is already gone in the wrong direction.
From the little I see in your question, your custom operation's design is wrong for this purpose. It should return the 4-digit value right into the hrs field - not into the variable key.