Is there a way for a building to fire a single shell with a single quartered unit as a limit?

With the new “Sapper Tunnel” unit, I’m trying to simulate underground attacks that affect buildings and walls. I have created a military unit called a “sapper” that can build the sapper tunnel and program the sapper tunnel to launch a long-range projectile that advances very slowly and only affects buildings and works well. But I wanted him not to “fire” the projectile until the “sapper” is quartered, but I have discovered that to at least launch a projectile in a building it is necessary to have a minimum of 3 spaces for units and that there are at least two units inside the building

I don’t know if it’s something I’m doing wrong or if it’s really a limit. The second thing is that I have not been able to understand how it works, how to program a new unit to make a building launch projectiles. For example, if in a barracks tower a villager or crossbowman can throw extra projectiles, but if quartered a pikeman he does not throw anything, so when quartered to the “sapper” in the “sapper tunnel” he does not throw anything, but if he quarters crossbowmen or villagers do launch the projectile.
And I don’t know how to make the “sapper” launch a projectile when it is quartered, but also that the “sapper” is the only unit that can be quartered and with just one it is enough for the tunnel to “launch” the missile.

I would very much appreciate guidance