While racers are on tempo, 5 km in red tempo is a thing, 10 km in red tempo probably is much more than losing energy.. you lose stamina!
(Stamina should be added to the super secret magic recipe between skills and energy!)
So could be very simple to do a Skillx - Stamina
Stamina = [(reg/10)- kmsum]
kmsum start as 3
Kmsum = Kmsum + fatigue
Fatigue = fatigue + 0,3 for red tempo or 0,2 for blue or tempo 0,1 for green tempo
As you can see the parameter kmsum start at 3 this give the chances to made 1 km in red tempo without any malus! (it could start at 2,5 but than a 60 reg guy can do 13 km in red tempo without malus)
This seems hard to understand so let's have an example
Alex von pippen is a climber that have
90 mountain 60 flat 35 reg
After the 1 km in red tempo he will push for 90 mountain and 60 flat kmsum now is 3,3
After 2 km in red tempo he will push for 89,9 mountain and 59,9 flat kmsum now is 3,6
after 10 km in red tempo he will push for 87,5 mountain and 57,5 flat kmsum now is 6
Edit: Always remember the formula: Stamina = [(reg/10)- kmsum]
This is the second part, when you jump off tempo the kmsum don't reset to 3 or 2,5
While not in tempo kmsum = kmsum - <[x + (energy / (2000 - reg))] /2>
x= 0,6 if no tempo in peloton
x= 0,4 if green tempo in peloton
x= 0,2 if blue tempo in peloton
x= 0,1 if red tempo in peloton
in our example the group is doing red tempo and Alex Von Pippen has 600 energy so the value of kmsum after 1 km out will be
kmsum = 6 - [(0,1 + (600 / 1965)) /2]
kmsum = 6 - [(0,1 + 0,3) /2]
kmsum = 5,8
While not in tempo Fatigue = Fatigue -( x /2)
This sistem can finally give us more strategic things

Any suggestion?