Close window without closing application
Have you thought for a keyboard combination like cmd+w?

In Google Chrome you can close all tabs with cmd+shift+w, in Safari the same way.

Alternatively you can write an AppleScript like tell application "Terminal" to close front window or as terminal command: osascript -e 'tell app "Terminal" to close front window'.