Structures that extend to ground

How would I make the bottom layer of a structure repeat until touching the ground? I don't think any datapack-based vanilla structures do this. The only examples I can think of are nether fortresses and desert temples, which are hard coded. I know YUNG's Better Nether Fortresses do, but I'm completely clueless as to how. Any help is appreciated, thanks in advance.
Continue to help post