To provide a coder-friendly JXA script that you and others can use to learn and modify, I have provided this macro/script:
MACRO: Get List of KM Macro Names Filtered By Macro Group and Macro Name [Example]
To get JavaScript coding help on almost any term or expression, just do a Google search with:
"JavaScript <and whatever you want help on.
"
If have found this very very often provides the info/help I need.
Let me know if you have any JXA questions.