Formula in shared parameter

I would like to know how to add formula to the project parameters that can be applied to the MEP pipes, ducts and cable trays. It is because it should be convenient for us to add the designed Tag.

The parameters are referred to the parameters of the MEP segments and create new values by the formula. For example, a parameter AbsoluteLevel (say) is assigned to the duct. It can calculate the absolute level automatically and can be shown in the tag. In fact, I found the parameters created by the other parties worked as this. May someone gives me the ideas in how to do this? Thank you very much!

The related files can be downloaded from this link. Thank you very much!