Hi and welcome to KnittingHelp!
You can decrease nicely around the beanie, but you won't be able to maintain the k3p1 pattern. What you can do is decrease by knitting 2sts together over the k3 portion of the pattern, say every other k3. It won't work out precisely evenly but after the next decrease round you should be ok. Then work a round on the sts as you see them (knit the knit sts and purl the purl sts) with out any decreases. So you would have k3p1, k2p1 repeated around. Then you can again decrease on the alternate k3 columns. Continue to alternate decrease rounds with plain rounds until you get down to around 12sts and then k2tog all the way around, cut the yarn leaving at least a 6inch tail and finally draw the yarn through the live sts and fasten it off.