Looking for a hook in JUCE plugin for REAPER rendering "selected tracks via master"

Hi all,
I´m looking for a place in a custom JUCE plugin to put code, which is called only once per track when rendering “selected tracks via master” in Reaper.

My project is: I´m working on mixing all tracks with one Midi hardware EQ. For this I have developed a JUCE Midi controller plugin to change the settings. This will be on each individual track, to store the settings. For mixing I want to capture the EQ sound with Waves QClone. Then for rendering I´d like to put the Midi EQ on the master via ReaInsert and render all tracks directly through it.

The idea here is to render all tracks via master, and have each individual EQ plugin first send it´s data to switch settings, and then render the track.

I´ve tried putting the code for switching the settings into “prepareToPlay” and also in the main “process” function, but unfortunately both functions get called multiple times by each instance, even during rendering one single track. So I cannot use it, because the settings will get overwritten.

Do you know of any place to put the code, or an option/script etc in Reaper to fire a plugin function (button etc) once per track in rendering “selected tracks via master”? Or anything else that might help me achieve this goal?

I´ve seen the option in the render menu “process all tracks during stem render”. This is turned off, but still all tracks get processed.

Thanks!