Custom activity streams from fit file messages

I’m trying to pull total_ascent and total_descent from the FIT session. Hopefully this will allow me to make a Fitness graph in week and month chunks that display Ascent and Descent in Hiking and Alpine Skiing activities.

What am I doing wrong? (Clearly, I know zero about scripting.)