Cone shaped 3D Mask in Material?

I want to preface this by saying that I am not a programmer or even good at math, so please bear with me.

My goal is to get a cone shaped 3D mask that I can manipulate inside a material, but I’m having a lot of trouble figuring out how to go about it.

​I looked everywhere for solutions and the best I could find was to create one using distance functions: Inigo Quilez :: fractals, computer graphics, mathematics, shaders, demoscene and more

The capped cylinder mask seems to work perfectly fine.

But I am having trouble getting the capped cone to work.

As you can see it’s a complete mess. I’m not sure where I am going wrong with this and it’s probably something really dumb. For instance I don’t really know the difference between “exact” and “bound” and what that means in this case. I would greatly appreciate some help on how to create this mask. If there are possible alternatives to this I would also love to hear them.

Thank you!