Anita Creswick had been caught stealing five bottles of gin from Morrisons in Guiseley and released by security staff moments before the attempted robbery on August 14, 2017.
Also in court: Man jailed for attacking victim with champagne bottle then shooting him during Leeds Carnival celebrationsLeeds Crown Court heard how the 39-year-old witnessed the victim withdrawing £100 from a cash machine outside the supermarket and tried to snatch the money.
But the victim, a 49-year-old woman, had a tight grip on the cash and refused to let go.
Prosecutor Jessica Randell said it was then that Creswick threatened to stab the woman with a used needle and said she was HIV positive.
The victim still refused to hand over the cash and Creswick continued to make threats until the woman got near the supermarket entrance.
Ms Randell said the victim's finger was cut and she feared a needle had been used, although she did not see one and there nothing on CCTV footage to suggest one was used.
The woman went to hospital but there were no further complications.
When Creswick was arrested, she admitted the offences and apologised but denied making any threats.
She told police she had been left feeling desperate after getting caught with the gin and needed money because of her heroin addiction.
Creswick, of Parkland View, Yeadon, earlier admitted theft and attempted robbery but had her sentencing deferred to give her a chance to access drug treatment.
Ian Cook, mitigating, yesterday said Creswick had been doing "reasonably well" and was reducing her use of street heroin after getting a methadone prescription.
He said she now had a permanent address with a family member on the condition she continue to work with the drug and alcohol service Forward Leeds and she hoped to secure employment in the future.
The Recorder of Leeds, Peter Collier QC, said Creswick's addiction and desperate need for money had driven her actions that day.
"The poor lady who was your victim was very terrified by some of the things you said to her," he said.
Noting that Creswick did not have a long history of offending and had admitted her crimes immediately, he said that a suspended sentence could be considered.
He handed her a 12 month prison sentence, suspended for 18 months, with a nine month drug rehabilitation requirement and 10 rehabilitation activity days.