@Nico, I hope you don't mind that I have revised your topic title to better reflect the question you have asked.
FROM: Complicated button switch macro - any KM wizard with an idea?
TO: How Do I Determine Status of Multiple Checkboxes, and Check/Uncheck as Needed on a Midi Monitor Window?
Providing a succinct, yet descriptive title about your problem/issue will greatly help you attract more experienced users to help solve your problem, and will help future readers find your question, and the solution.
If the window is fixed, and in a fixed location, then you could use the Find Image on Screen action, with a very small screen area covering just the checkbox area of the button, and search for the checkbox (on or off) to see whether it is on or off. Repeat for each checkbox. If the checkbox is incorrect, then toggle it as necessary.
Since the search area will be very small (only a bit larger than than the checkbox), that would probably be quite fast.
Alternatively, you can use the Pixel condition, which would be fine for this case, just pick a pixel within the checkbox that is light when off and dark when ticked).
I note that Monitor E, the checkbox is in a different location, so I don't know if the others can change, which would complicate the exercise.