Automating the substractiom of a single trace from a multitude of traces

As the subjects states, I'd like to automate what I am currently manually doing with the wave arithmetics panel: substacting two traces from each other. Here I am substacting an averaged trace from individual traces one after another, which can get tedious if I have to do this for hundreds of traces manually.

Thanks!
I am currently learning a lot thanks to your great example from the other thread, but sadly it is too complex a task to modify the procedure in a way to add a subtraction function right away. I better start with a programming tutorial for Igor I found elsewhere, hopefully I can wrap my head around this problem quickly.