Template for calculating last triggered of a group of scripts

HI,

using Tiles custom ui, I need to set the color of a button (activating a script), or the background image of that button depending it being the the last_triggered of a group of scripts.

Other than using color_on/off (which i cant use since all scripts are ‘on’ , the Tiles custom ui offers various possibilities to do so, looking at style_template now, but i cant figure out the correct template for calculating which of the scripts ran lastly.

Something like below:

style_template: "if (state === {here should the template go)) return 'color: on';
                            else return 'color-off';" 
or  "return 'background-image: url(\"/local/' + state + '.png\");'"

i have a group of 6 scripts, hope this is enough info to help me,

thanks,
Marius