I looked into the entity data of crossbows, and saw the Charged attribute.
So, I used the replace item command to give myself a crossbow that fires an arrow, with Charged set to 1b. However, upon attempting to fire the arrow, nothing happens and the crossbow is reset. The command is shown below.
/replaceitem entity @s hotbar.0 minecraft:crossbow{tag:[{id:"minecraft:arrow",Count:1b}],Charged:1b,Damage:0}