The game is tied, or your team is down 1 or 2 points, with 4 seconds left in the game. Since you are not playing in the NBA (where they get the ball at half-court), you must go the full length of the floor. Here is one strategy you could try. This assumes you have at least one time-out left.
Break the remaining time up into two segments. Since the clock doesn’t start until a player touches the ball, first cut the court in two and make the pass to half-court and immediately call time-out. While you are explaining the play to your team, have your assistant go over to the ref and inform him quietly what you are doing, and that you will be calling time-out and want the clock stopped immediately. This puts the ref on the spot and he won’t be able to say that he didn’t hear you call time-out. Ask the ref also to inform the clock-keeper. If done correctly, you should only lose 1 second with the pass to half court. See Diagram A. Have two players at half-court and two players deep. Have the two half court players run deep, and the two deep players cut to the ball at half-court. O3 is your best long passer. Call time-out as soon as the ball is caught.
Now, you have the ball on the sideline at half-court with two or three seconds left on the clock. Once again, the clock doesn’t start until the ball touches a player. I think your best options for a clear shot are (1) ball-side corner, (2) weak-side wing (using a skip pass), the lob to your tall post player in the lane. You must instruct your players that whoever receives the ball, must shoot it… there is no time for a pass or dribble. See Diagram B. Set your players up in a tight "diamond" formation. Have your best shooter O2 cut through the diamond to the ball-side corner for the pass and shot. Have your other good outside shooter O1 cut to the weak-side wing, looking for the skip pass and three-point shot. O4 cuts toward the ball, 3-point arc area, while O5 tries to get position for the long lob pass to the lane. O3 is your strong-armed, best passer and must find the open receiver. If no-one is open, O3 should make the lob pass to O5, hoping that there could be contact and a foul going for the pass… you could win it on the free-throw line.
The odds are against you, but at least you have a chance if you have a plan, and have practiced for this situation.