How to kill a process and its childs given pid and userid

I need to write a shell script which would take 2 arguments pid , userid. Then it should kill all the child process under it. If a child process is not killed then it should wait for 1 minute and should kill.

can anybody give me the idea to write it?