Understanding Functions Better

So I’m kinda new to UE4 and scripting in general, but I have basic knowledge of blueprint. I’m confused about how functions work/how to use them, and I want to make a weapon system that has a base weapon and children being the actual weapons. My problem is is that I don’t exactly know how to create a function for things like fire or reload or magazine size, and I can’t seem to figure out how to cast it to my player controller properly. Any help is greatly appreciated!