You are on the right track, but as someone has commented your conjugations need some work.
However, I'll give you what I would suggest is a natural way to ask this.
I think you could replace with simply , but I think the above is more clear.
Besides your issues with and , you don't need to use . Often in Japanese it's best not to use any word for "you", as it is implied and each word that means "you" has its own nuance.
If you want to use this for other things, you can just put the action in the "pre-masu" form (i.e. ) followed by this phrase:
This would translate to "How long have you been ~?"
EDIT: Replaced with
EDIT: Added general pattern