In an action for the recovery of specific personal property, if the property has not been delivered to the plaintiff, or the defendant by his or her answer claims a return thereof, the jury shall assess the value of the property if their verdict be in favor of the plaintiff, or if they find in favor of the defendant and that the defendant is entitled to a return thereof, they may at the same time assess the damages, if any are claimed in the complaint or answer, which the prevailing party has sustained by reason of the detention or taking and withholding such property.