Unmanned aerial vehicles (UAVs) are considered an important component of 6G wireless technology. However, there are many challenges to the employment of UAVs, one of which is spectrum scarcity. To address this challenge, non-orthogonal multiple access (NOMA) and cognitive radio (CR) techniques are employed in UAV short-packet communication systems. In this paper, we consider a NOMA-based cognitive UAV short-packet communication system. Firstly, a mathematical expression for the effective throughput of the secondary users is derived. Then, we aim to maximize the effective throughput of the far secondary user by optimizing the sensing time, power allocation, and information bits under the constraints of the transmission power and effective decoding error probability. A joint optimization algorithm is used to solve this problem, where the bisection method and the one-dimensional linear search algorithm are used to solve the subproblem. The simulation results show that the proposed algorithm has low complexity and similar performance compared to the exhaustive method. In addition, the necessity of joint optimization is shown in the simulation results.