My question involves criminal law for the state of: CA

ok lets say the person below me calls the police for a Noise Complaint after 11:42pm ( it was the cat ) stupid loud litter box.

i go downstirs let person know it was the cat Scraping hard at her box for a while.

person tells me i should have it put down or just move if its that loud.

i tell them im here just letting you know its the cat and next time DO NOT POUND on roof, just come to my door and let me know, then it turns into this and that but at the end of the talk and yelling about you dog & your cat should be killed and u should move. No One Got Hurt, Touched or killed. ( NO ANIMALS WHERE HURT ) in the making of this post.

so 8minutes later ( fast response time ) 2 cops show up strapped with Gun, Tazser & note pad, i talked to them and let them know what was going on.

After 5 minutes of talking Nicely and clam, i was told this scary comment ** ( NO CRIMES where done tonight, so you wont be going to jail ) just dont go talk to them again or anyone again just call the police you could have gotten shoot or hurt you dont know who u are encountering.

cops left.

Now my question is this: what could i have done with the police: ( not to sound like an butt or evil person ) but i dont feel i has to talk to them.

could i have said this when they came to the door ask “am I being detained or am I free to go? “ & close the door?

if they asked for id ( which they did omg & i showed them ) could i have said NO i do not consent to showing you my id? ask “am I being detained or am I free to go? “

Could i have just plead the 5th and remained Silent?