Thanks to your explanations, I had fun modding components!
Juste in case, for archives, I wanted to customize the Alert system to filter out or in specific buildings, I could modify the component: simulation/components/AlertRaiser.js
let holder = cmpRangeManager.ExecuteQuery(unit, 0, +this.template.SearchRange, mutualAllies, IID_GarrisonHolder, true).find(ent => {
const classes = Engine.QueryInterface(ent, IID_Identity).GetClassesList();
//Filter only buildings from a class
if (classes.indexOf("House") === -1)
return false;
[Other conditions...]
let cmpGarrisonHolder = Engine.QueryInterface(ent, IID_GarrisonHolder);
if (!reserved.has(ent))
reserved.set(ent, cmpGarrisonHolder.GetCapacity() - cmpGarrisonHolder.OccupiedSlots());
return cmpGarrisonHolder.IsAllowedToGarrison(unit) && reserved.get(ent) >= size;
});