How to apply ADSR envelope to sidechain audio?

I’m not an under the hood kind of guy with Halion, so I’m wondering how straightforward it is to get Halion to do what I want. Or if there is a totally different approach I should take.

Basically I’m trying to create something like the MIDI Gate Insert. But instead of a simple On/Off like with MIDI Gate I want it to be an ADSR Envelope. So I’m thinking of taking the Sidechain Input and routing it through an Envelope Generator and then out. Any advice appreciated.