Customizing option-close Window in SwiftUI?

I have a SwiftUI app made up of two types of window. If I hold the option key while clicking in the close box of one window, it closes all the app windows.

I want to change that behavior to just close all the windows of a particular type (or use any other criteria, for that matter). Is this even possible?

Customizing option-close Window in SwiftUI?
 
 
Q