To start, you need the type of Pokeball you want to clone and at least one other type (for example, I want to clone a Masterball, I need a Masterball and some other -ball). Now, go into a battle with a Shadow Pokemon. Once the Shadow Pokemon is called out, have your first Pokemon's action use the ball you want to clone on the Shadow Pokemon. Now, with your second Pokemon, go to the ball menu, highlight the ball you selected, press X, move to another ball, and press X again. The positions of the two balls should have switched. Now, exit the item menu, and use a move (doesn't matter what it is). Now, when the turn starts, your character should use the ball you selected on the Shadow Pokemon. Once the turn/battle ends, check your inventory. The ball you used should still be there (if you had more than one, you will still have as many as you had before). If anyone knows why this happens, please tell me, because I have no clue.