Create attribute based on primitive lifetime

How could I create like an "@age" attribute but based on primitives visibility/existence? each one of this lightning curves has it's own ID.

I want to use this attribute as fade for Cd. Any suggestions? Thanks in advance!

Video: https://imgur.com/a/pqyo3AV